Categories: System Configuration

Disable or Enable Windows Automatic updates from command line

We can disable Windows automatic updates from command line using the below command.

reg add "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto Update" /v AUOptions /t REG_DWORD /d 1 /f

I tested this on Windows XP, Windows server 2003 and Windows 7 and it works perfectly. After running the above command you can also see a balloon popping up near the system tray with the message “Your computer might be at risk… Automatic updates is turned off……“.

Note that this will not work if domain group policy is enforced and users are prohibited to change the settings. In Windows 7, we can find out if a GP is enforced or not by opening windows update window. Go to settings and see if the options are greyed out for ‘Important updates’. If so, then it’s controlled by administrator/domain policy and can’t be edited. In XP, same can be checked on ‘Automatic updates’ tab in Computer properties(sysdm.cpl).

To enable automatic updates we need to set the registry value to 0. Command is given below.

 reg add "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto Update" /v AUOptions /t REG_DWORD /d 0 /f

If you want to download updates but not install till the user acts on it then you can set the registry value to 3.

reg add "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto Update" /v AUOptions /t REG_DWORD /d 3 /f

If you want to disable Automatic updates service then run the below command.

 sc config wuauserv start= disabled

IF you want to stop Automatic updates service then run the below command.

net stop wuauserv

Command for starting automatic updates service:

net start wuauserv

Command for enabling the service:

sc config wuauserv start= auto

Errors

In Vista/Windows 7, the above commands should be run from elevated administrator command prompt. Otherwise you would get the following error.

c:>reg add "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto Update" /v AUOptions /t REG_DWORD /d 1 /f
ERROR: Access is denied.
Srini

View Comments

    • I believe if you do "net start wuauserv". The windows update will start to work

      to disable you type in "net stop wuauserv" in the command promt.

  • It can be used to enable also. The command would vary slightly.. just replace 1 with 0. Please see the command below after making this change..

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 0 /f

  • Thanks i tested that with Vista it worked for that too .
    In my windows update page was having error i did nt have any way other than to disable or enable automatic updates through command prompt.

    Best Regards

    Kanwal

    • Get the registry value using 'reg query' command. you can know the updates on/off status based on the registry value

  • Thank you for pointing out the relevant registry keys and how to modify them, the information was most helpful.

  • The Access Denied message comes if you don't run command using Administrator privileges, the command works perfectly..you can as well use the GUI..it works perfectly

Recent Posts

Add new user account from command line (CMD)

Adding users from command line is much easier than going through the UI. It saves…

4 years ago

Delete directory from command line [Rmdir]

Do you want to delete a directory from Windows command prompt(CMD)? This post explains how…

4 years ago

TaskKill: Kill process from command line (CMD)

We can kill a process from GUI using Task manager. If you want to do…

4 years ago

Kill Chrome from command line

Chrome is definitely the stable browser compared to other ones and it has been my…

4 years ago

Find windows OS version from command line

Windows has multiple command line utilities that can help find the version of the Windows…

4 years ago

How to check if Windows 32 or 64 bit?

There are multiple ways to check whether a Windows computer is running 32-bit OS or…

7 years ago