Elevate Cmd to Admin with Command Prompt? [Duplicate]
This Question Already Has an Answer Here: Elevate a Running Program to Administrator (Windows 7) (1 Answer) Closed 8 Year's Ago. Is There Anyway to Enable...
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
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.
It is not built in to Windows, but you could use the psexec command from PsTools:
psexec -h cmd
Try the following.
- Locate the command prompt (
cmd.exe). - Right click on the file, go to
Send To-Desktop (create shortcut). - Right click on the file again and go to
Properties. - The target field put:
C:\Windows\System32\runas.exe /noprofile /user:Administrator cmd
- Open the shortcut, the following screen will be presented to you.