Restart windows update from command line

Command-line switches for Microsoft software update packages

This article describes the consistent set of command-line switches that Microsoft is adopting for deploying packages that contain software updates.

Original product version:  Windows 10 – all editions
Original KB number: В 824687

Summary

Microsoft is adopting a consistent set of command-line switches that you can use to deploy packages that contain software updates, such as security updates, critical updates, and hotfixes. This article describes these new command-line switches and their behaviors.

Packages that support these new command-line switches also support earlier command-line switches for backwards compatibility. However, usage of the earlier switches should be discontinued as this support may be removed in future software updates.

For additional information about command-line switches that are used by Windows software update packages, click the following article number to view the article in the Microsoft Knowledge Base:

262841 Command-line switches for Windows software update packages

For additional information about command-line switches used by Windows Installer, visit the following Microsoft Web site:

For additional information about the standard terminology that Microsoft is adopting to describe software updates, click the following article number to view the article in the Microsoft Knowledge Base:

More information

Microsoft is adopting the following command-line switches for software update packages:

/help; /h; /? — Displays a dialog box that shows the correct usage of the Setup command, including a list of all its command-line switches and their behaviors. You can display this help information in the command-line interface (CLI) or the graphical user interface (GUI). If you use any command-line switch incorrectly, this help switch is invoked and the correct usage is displayed. The dialog box also provides references to more online information.

/quiet — Runs the Setup program or the removal program in «quiet» mode. The program doesn’t prompt the user with any messages. The program enters all messages in a log file. By default, the program restarts the computer with no prompt or warning if the process requires a restart for the changes to take effect. To change the default restart behavior, use a different restart mode.

/passive — Runs the Setup program or the removal program in «passive» mode. The program doesn’t prompt the user with any error messages. The user sees a progress bar that indicates that the installation or the removal is occurring. The user can’t cancel the installation or the removal. By default, the program invokes the /warnrestart switch. If the program is installing multiple updates, the progress bar indicates the progress of the installation or the removal for each update.

/norestart — Doesn’t restart the computer after the installation or the removal, even if the process requires a restart for the changes to take effect.

/forcerestart — Restarts the computer after the installation or the removal, even if the process doesn’t require a restart for the changes to take effect. Restarting forces programs that are running to close.

/warnrestart[:x ] — Invokes a dialog box that warns the user that a restart will occur in x seconds (in 30 seconds if no value is specified). For example, to warn that a restart will occur in 60 seconds, type /warnrestart:60. The dialog box contains a Cancel button and a Restart Now button. If the user clicks Cancel, the computer isn’t restarted.

/promptrestart — Prompts the user that the computer must be restarted for the changes to take effect. The user can select whether to restart the computer.

/uninstall — Removes the package.

/log — Enables the user to define the path for the local log file. This switch invokes the default logging behavior.

/extract — Enables you to extract the installation files to a specified folder.

Reboot Windows computer from command line (CMD)

We can reboot a Windows computer from command line using the in-built shutdown command.В Below you can find syntax of this command for various use cases. The below commands work on Windows 7, Windows 8, Windows 10 and all other server editions.

Читайте также:  При установке windows компьют

Command to reboot windows computer

The above command will set a time out of 30 seconds to close the applications. After 30 seconds, windows reboot will start.

If you want to reboot Windows with your own time out value you can use the below command.

To shutdown a Windows computer

To abort computer reboot

If you have issued a reboot command and have changed mind, you can stop Windows reboot by running the below command.

When you run this, you would see a pop up window at the right bottom part of the screen(near system tray) that shows the message “The scheduled shutdown has been cancelled”.

To force reboot by closing applications without warning

Open the shutdown GUI

Add reason for the reboot of the computer

Reboot Windows using WMIC commands:

Reboot windows using WMIC

You can run the below wmic command to reboot Windows OS.

Is the abort command supposed to work if one has issued the reboot from GUI. I have tried this on my Windows 7 Ultimate, it does not seem to be working. it says ‘no shutdown was in progress’

Abort works only when you had issued the reboot/shutdown using the command. GUI actions are not aborted by /a option.

I’ve just attempted all commands from Windows 7 Ultimate install disk (used as recovery disk) and I obviously have a fault with my disk trying to load the Windows installation volume, I’ve launched command prompt via shift F10 as the GUI was not responding or should I say it had a never ending hour glass, trying a force shut down resulted in ‘the function is unknown’ proceeded with some numerical digits inside of closed brackets?

Shutdown /a is very handy when windows update tries to force reboot your computer. You can run this command and cancel the reboot if you don’t want the reboot to happen at that time.

How to run Windows Updates from Command Line in Windows 10

Windows Update is one of the most highlighted features of Windows 10. Because with the release of Windows 10, Windows was offered to the customers as a service rather than a product. Under the scenario of Software as a Service, this led to the Windows Updates on Windows 10 being on by default and without an option for anyone to disable it. Now, while some criticized this move by Microsoft, ultimately this is a step towards the customer’s greater good. Because Windows Update helps the users stay secured against all kinds of threats and provide them with the latest and the greatest from Microsoft. So, those who appreciate this service, today we are going to talk about another way to run these updates.

Run Windows Updates from Command Line

The following methods will be carried out to run Windows Update from Command Line on Windows 10,

  1. Using Windows Powershell.
  2. Using Command Prompt.

1] Run Windows Update using Windows Powershell

Running Windows Updates on Windows Powershell will require you to manually Install the Windows Update module, Get Windows Updates downloaded and Install Windows Updates. And for this, open Windows Powershell by searching for Powershell in the Cortana search box and run it with Administrator level privileges.

to install the Windows Update module for Windows Powershell.

to connect to the Windows Update servers and download the updates if found.

Finally, type in,

to install the Windows Updates downloaded on your computer.

2] Run Windows Update using Command Prompt

Command Prompt on Windows Operating Systems exists since a very long time whereas Windows Powershell is comparatively new. Hence, it has similar capabilities to run Windows Updates, but the highlighting point here is that you do not need to download any module for Windows Updates.

First, open Command Prompt by searching for cmd in the Cortana search box and run it with Administrator level privileges.

Click on Yes for the UAC Prompt that you get.

Finally, type in the following commands and hit the Enter key in order to perform the respective operations,

Start checking for updates:

Start downloading Updates:

Start installing the downloaded updates:

Restart your device after installing the updates:

Check, Download and Install Updates:

It is worth noting that, the Command Prompt commands mentioned above are just meant for Windows 10. For older versions of Windows, you need to use the following commands,

Start checking for updates:

Start installing the detected Updates:

Check, download, and install updates:

Hope you find this post useful.

Stop Windows Update service

This post explains how to stop Windows update service from command line(CMD). Make sure that you open elevated administrator command prompt to execute this command.

Читайте также:  Midi драйвера для windows 10

How to stop Windows update service

Do the following

  1. Open elevated command prompt
  2. Run the below command.

Update service restarts automatically

It’s observed that just stopping the service does not work in some cases and it restarts automatically. In such cases one can disable the service completely by running below command.

Note that these commands to stop or disable service should be run from elevated administrator command prompt. Other wise you will get the following error.

How to start windows update

Neat tip. However, it seems W7 is automatically restarting the Windows Update service every now and then. I’ve changed status to “Manual” under services.msc but the behavior remains. No fun at all.

Hi Carl
FYI everytime you go into windows update it will start the service even though it is set to manual so if you need to look in windows update then stop the service again afterwards.

Run CMD as Admin and “sc config wuauserv start= disabled” will work on Win7Ulti

Please help me to stop the windows update, it is a disaster every time after windows update, totally stupid program, may be next time I should go for apple.

you gott the error because you have’nt run cmd as administrator

Apple is more stupid than the windows.

I cannot get windows update to stop, finish, or go away! How do I get this to stop so I can get back on the computer? It’s a brand new computer, and useless at this point!

Set to disabled and reboot!

Wow thank you for putting this line up here. I needed to restart my windows update and this did the trick

Yes – agreed thanks much appreciated! On a very slow connection so bandwidth is at a premium. This made things much more pleasant.

#Persistent
interval = 600 ; execution interval in seconds
Menu, Tray, Add ; divider line
Menu, Tray, Add, Execute Now, StopService
Menu, Tray, Default, Execute Now
timer_param := -1000 * interval

StopService:
Run %comspec% /c “sc query wuauserv | find “1 STOPPED” & if errorlevel 1 sc stop wuauserv”, , Hide
time = %A_Now%
time += %interval%, seconds
FormatTime, time_string, %time%, Time
Menu, Tray, Tip, Stop Windows Update Service`nNext Execution at %time_string%
SetTimer, StopService, %timer_param%
return

Hi! even thou i star cmd as admin i still get the “error 5 access denied. can someone help me?

go to start menu —> type “cmd” in the search box, wait till cmd shows in the results list, right click on “cmd” and select “run as administrator”

You need to run it from elevated command prompt.

otherwise, check your UAC and if it’s off, turn it on in your account settings.

This information is for those who wish to completely disable Windows 10 automatic updates. It is very simple and requires no real expertise.

1. Bring up your task manager.
2. Select the “Services” tab.
3. Scroll down the lefthand side until you see “wuauserv”. (In the description column to the right, you’ll see “Windows Update”.)
4. Right click on “wuauserv”.
5. In the dropdown box that appears, click on “stop”.

This stops all automatic updates from taking over your computer. In order to get future updates, you will have to follow the same steps, but click on “start” to restart it. I prefer simply to go to Microsoft’s website to find the updates, if I want them at all, which I don’t. I’ve struggled with Microsoft’s updates for years, from Windows 7, Windows 8, Windows 8.1, and now Windows 10. All of them have rendered my computer(s) less functional than they were prior to the updates.

I use a separate security program in conjunction with Windows firewall and find that there is absolutely no need to upload their security updates.

hi, I am having endless problems with my surface pro3, running win10pro. the overwhelming majority of my time spent on this device is occupied by trying to update and keep in functioning without sending me endless notifications. I am an aspiring Linux user, which so far as I can tell, is superior in every way, however, I am concerned if the security is dependable…? I was wondering what the security program is that you referenced? and would be eager to hear any other suggestions/tips/opinions?

I tried this and got a message that access is denied.

Same problem on my PC. Svchost.exe takes continuously almost 100% processor time.
Stopped wuauserv in the way described above and the processor is free. However after a restart it is running again. Same after stopping it via the command: net stop wuauserv.
Anybody knows how I can stop this wuauserv forever.

Читайте также:  Ldap linux что это такое

You need to disable the service using sc command. Added these commands in the post.

Hi all, a tip for all of those having issues with Windows update, if you go to services.msc and stop the service in the second tab you can select a user to run the service with afterwards.
So you only need to put a valid user and then change the password of that user and voila! it wont ever be able to run again since it will be trying to run with an invalid user… 🙂

I wind up stopping and disabling this service every day or two, yet somehow Windows keeps turning it back to Automatic and running it! (on an older laptop which has to stay at XP)

Just want to say Thank YOU! I got nearly crazy (even more than normal) because my laptop was making so much noise while windows was checking updates for hours. Tried to close it through task manager to no avail but this tip worked as a charm.
I had no problems at all that was until windows installed updates and I could not get into windows anymore. Thanks no thanks. So now I am going to try to see if I can download the updates one by one or so. Thanks again. Love the sound of silence

Surely it would be much easier to use computer management services scroll down to windows update and apply the above directly with the advantage that you can see what you are actually doing.

Thanks for the tip. CPU had been running crazy trying to keep up with the update service. The CPU temp has dropped from 43 degrees Celcius to 35 degrees.

Omg! Thanks you! I was stuck in windows update hell!

Thanks for the info. I made a .bat file to stop, and one to start with this info. Just run as administrator and it works 🙂

I hope the above stop up dates work as my computer is all bet useless

from cmd run
sc queryex wuauserv
take pidnum from result and replace xxx in
taskkill /PID xxx/F and run

This is a good short term (few days) fix but on Windows 10 home edition, update restarts itself after a few days. There is a regedit out there but it doesn’t work for Home edition. The WUSH tool also only works for a few days.

Would be great if there were a way to program this “sc config wuauserv start= disabled” command to re-run itself every 2 days. Does anyone know how to do this?

Just put the command in a batch file, then schedule a task launching it with highest priviledge “when the computer starts”. (^v^)

i am running cmd as administrator but also the following cmd net stop wuauserv is saying invalid what to do then

Erm… I disabled the command using the command prompt (admin), but the file Windows10Upgrade keeps appearing. Help me please!

I can’t stop windows 10 update using service stopping, when I connect to wifi ,service is auto enable how can I stop permanently

Is there any command just to show the windows update is on or off ?

How can I disable windows updates for all the computers on the network?

Unfortunately, Windows 10 Home does not allow users to turn off automatic updates. To do that, you would have to upgrade to the Pro version. Otherwise, you’re looking at a lot of punishing hours spent rolling back updates you didn’t want… I had this issue with an error related to a registry conflict that prioritizes RuntimeBroker and found that this was the case during my research into the cause for the ongoing rollbacks.

I have no access to stop and disable the services. Can anyone tell me what to do in this case?

Hello, I am searching across the internet to find a solution to fix the svchost.exe disk usage, and almost every one of them suggests to disable or turn manual the Windows Update Service. I already did that, but the svchost.exe thing keeps consuming my disk.

If you know how to fix this, please tell me.

Can always services >Windows update
right click, properties, Revoery, and change to no action for all 3… see if that may help.

Thanks, had to get around an invasive group policy to repair bitlocker bde protectors, this was the trick I needed to disable updates so my bitlocker tables could be repaired.
Brent, New Zealand

Оцените статью