Featured Resource:

line

Newsletter

Email Address:


line

Ask the Expert

Have a question for our resident expert? Email your questions to Bob or post in the Forum.

« Vista Performance Features | Main | Stop Programs from Running at Startup »

Controlling UAC from the Command Line

Turn it off:

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

Turn it back on:

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

As I’m sure you can see, this simply updates the EnableLUA registry key (one is on, zero is off) which is located in the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System subkey of the registry. Naturally you’ll need admin privileges to change a HKLM settings so if you want to run this, you’ll need to do it from a command prompt being run as administrator.

Now the bad news: there is no way around it, this setting requires a restart of the computer. If you are trying to script that too, check out the shutdown command ;)

Library Resources

line
line

Bob Kelly's Bio:

Bob Kelly is the founder of AppDeploy.com — a resource focused on desktop management products and practices. He is author of the Start to Finish Guide to Scripting with KiXtart and The Definitive Guide to Windows Desktop Administration. He is also president and co-founder of iTripoli, Inc. who provide AdminScriptEditor.com, home to an integrated suite of scripting tools and a shared library of scripts and language help. Not enough? For more on Bob click here.