Enterprise Software

How do I enable or disable UAC from a batch file?

I go through phases on my Windows Vista machine where I am ok with using UAC and other times where I just want it to go away for awhile. I compare it to staring at a computer screen for hours. It is nice to take a break and get a hot cup of coffee or grab a Tall mocha from Starbucks. Here is how you accomplish the tasks.

I go through phases on my Windows Vista machine where I am OK with using UAC and other times where I just want it to go away for a while. I compare it to staring at a computer screen for hours. It is nice to take a break and get a hot cup of coffee or grab a Tall mocha from Starbucks.

The command-line entries to enable and disable are the following:

  • 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
  • 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
I created the following two batch files available for download:

Follow these steps to enable or disable UAC. After downloading and extracting the two zip files, right-click on one of them and choose Run as Administrator. In this example I will enable UAC (Figure A).

Figure A. Enable UAC.

When you enable UAC, a reboot (Figure B) is required.

Figure B. Reboot your computer after enabling UAC.

Alternatively, you can accomplish the same task by typing User Accounts (Figure C) in the Instant Search field.

Figure C. Use Instant Search to enable UAC.

Next, select Turn User Account Control On or Off (Figure D) and then tick the checkbox to enable UAC.

Figure D. Turn UAC on or off from the UI.

Figure E. Use this checkbox to enable or disable UAC.

4 comments
computab
computab

This is a packard bell AMD 64 Athlon X2 running Windows Vista Home premium 1GB RAM. When I ran 'disable UAC' with the above utility, I got access denied. When I tried to elevate the command with shift-control-enter, it did not elevate.

bcarpent1228
bcarpent1228

Vista is too complicated to disable the UAC popups --BUT-- the UAC is so common and so general i end up allowing everything. A real Catch-22 when install non-Microsoft products. Additionally i am not confident the UAC traps everything (i.e. i allowed one registry entry but found 8-10 actual entries were posted) the Linux su (super user) does force me into to predetermine all changes are valid -- a pain in the butt but my confidence level is higher.

CG IT
CG IT

UAC is supposed to block potentially harmful programs and batch files are the basic harmful program. The irritating part of UAC is that users have to approve just about every program that hasn't been written specifically for Vista.

Editor's Picks