This question already has an answer here:

Is there anyway to enable administrator access instead of having to right click command prompt and run as administrator?

I tried runas /user:administrator CMD (prompts for password) net user administrator /active:yes (System error 5 has occurred. Access is denied.) runas /user:administrator luaexec.exe -w -f cmd.exe /k

This is on my local machine running windows 8 and have no passwords on any accounts

marked as duplicate by Canadian Luke, Ƭᴇcʜιᴇ007, harrymc, Kevin Panko, Nifle May 27 '14 at 8:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Wait... Do you want to elevate the current cmd or open a new, elevated one? – PlasmaPower Mar 30 '14 at 14:58
  • I think there is a local security policy/directive that doesn't allow administrator logins nor executions for account with no passwords. Maybe that is your problem? Saddly, I don't know what directive that is, I suppose it should be at secpol.msc. If you find it, please, report. – Sopalajo de Arrierez Mar 30 '14 at 15:25
  • 1
    Is this method valid for you? superuser.com/questions/728810/… – Sopalajo de Arrierez Mar 30 '14 at 15:27
  • I have used this other method, too, but it is shell programming. You could make a .cmd to call it with your desired parameters, if any: stackoverflow.com/questions/5944180/… – Sopalajo de Arrierez Mar 30 '14 at 15:28
  • @Plasma - within the current cmd – nhat Mar 30 '14 at 16:14

It is not built in to Windows, but you could use the psexec command from PsTools:

psexec -h cmd
  • How to run this from usual (non-admin) CMD? Is it possible? – Suncatcher Dec 10 '17 at 10:25

Try the following.

  1. Locate the command prompt (cmd.exe).
  2. Right click on the file, go to Send To - Desktop (create shortcut). enter image description here
  3. Right click on the file again and go to Properties.
  4. The target field put:

    C:\Windows\System32\runas.exe /noprofile /user:Administrator cmd

  5. Open the shortcut, the following screen will be presented to you. enter image description here
  • Unfortunately I'm trying to run a script to update IP addresses and what's preventing the command from executing is the cmd.exe needs to be in admin. It would be time consuming to go to every computer to do this. – nhat Mar 30 '14 at 16:20

You can't change the permission from a current CMD.exe. You have to restart it. This is a Windows limitation. I use NirCmd with the elevate switch to start tools elevated.

Not the answer you're looking for? Browse other questions tagged or ask your own question.