How to toggling UAC on/off quickly, eg. using command line, in Windows-7?
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.
ps.
It would be lovely if the solution does NOT require to reboot.
Solution 1:
Run the following commands with Administrator privileges:
-
Disable UAC
%windir%\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
%windir%\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f
Solution 2:
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:
SET __COMPAT_LAYER=WINXPSP3