Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing codes which relates to UAC and need to turn it on/off very often.

So that I'm looking for a way to turning it on/off quickly, prefer to use command line.

Please share if you know how to.


It would be lovely if the solution does NOT require to reboot.

share|improve this question
there's a way to script it, but it requires a reboot....i have to go digging if i'm going to find it. it's a regkey toggle i researched a while back. – RobotHumans Jan 1 '11 at 4:38
Are you just using this code for personal use? Any application that goes around making changes to UAC settings is not going to make users happy. I would never install an application that makes changes to my UAC status unless I specifically told it to. – nhinkle Jan 4 '11 at 18:49
@nhinkle Yeah, I use it for my own, in debugging task only. – Nam G VU Jan 5 '11 at 3:49
up vote 10 down vote accepted

Run the following commands with Administrator privileges.

Disable UAC

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

Enable UAC

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

share|improve this answer
Unfortunately, enabling/disabling UAC will require a reboot no matter what you do. UAC makes Windows behave differently internally, not just to the user. – TuxRug Jan 1 '11 at 4:57
Though still need to reboot, I'll choose yours command to be the selected answer. Please update to note about running the command under priviledge mode & separate the two answers as two different approuches. Your answers are currently mixed & messy – Nam G VU Jan 4 '11 at 14:47
Sure. Just FYI - approaches, typo in your comment. – Sparx Jan 4 '11 at 17:59
@TuxRug UAC disabling is possible without reboot. try my answer. Seems to be an extra key, that asks for prompt. – pulsarjune Jul 18 '14 at 6:51

Ready for me to blow your minds with a hidden "feature"...

To disable UAC for all subsiquent commands in the same session--i.e. if you close the particular script or CMD sessions it resets and you just have to set it again to disable temporarily:


share|improve this answer

As an aside - If you are a computer administrator, and you still want to keep UAC for standard users, there’s an easy way to turn it off for administrators only.

Just open Local Security Policy from Administrative Tools in the Control Panel.

Then go to Local Policies > Security Options.

Scroll all the way down and find where it says something like: USER ACCOUNT CONTROL: Behavior of elevation prompt for administrators in Admin. Approval Mode;

Double-click it and then click the drop down list and change it to “elevate without prompting.”

UAC should no longer annoy administrators.

share|improve this answer
Thank you! Love to discuss & learn from you – Nam G VU Jan 5 '11 at 3:51

Finally, UAC disable/enable without reboot:

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f

Try and update. Cheers

share|improve this answer

You must log in to answer this question.

protected by bwDraco Sep 13 '15 at 23:45

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .