Windows update. CLI (Command Line Interface)
Сайт является не обновляемой с 20.07.2019 копией сайта alex-white.ru
Часто, бывает необходимо, подтолкнуть агента WSUS для проверки имеющихся обновлений и немедленной установки. Я для того использую простую команду wuauclt /detecnow
Но помимо этого, эта утилита имеет множество других применений и соответствующих параметров командной строки. Рассмотрим их:
/DetectNow — Запустить немедленный опрос сервера WSUS на наличие обновлений
/resetAuthorization — Сбросить авторизацию на сервере и клиенте. Фактически это новая регистрация на сервере WSUS. Полезна когда клиент подглюкивает, удаляем его на сервере и командой wuauclt /detectnow /resetAuthorization заново регистрируем на сервере с одновременным запросом списка обновлений
/reportnow Сбросить статистику на сервер
Остальные параметры не столь очевидны и самое главное их применение непонято и обычно не вызывает никаких изменений
/RunHandlerComServer — неизвестно
/RunStoreAsComServer — неизвестно
/ShowSettingsDialog — Показывает диалог настройки расписания установки обновлений
/ResetEulas — сбросить соглашение EULA для обновлений
/ShowWU — переход на сайт обновлений MS
/ShowWindowsUpdate — переход на сайт обновлений MS
/SelfUpdateManaged — неизвестно
/SelfUpdateUnmanaged — неизвестно
/UpdateNow — Немедленно запускает процесс обновления, аналогичен клику кнопки в окне уведомлений о наличии обновлений
/ShowWUAutoScan — неизвестно
/ShowFeaturedUpdates — неизвестно
/ShowOptions — неизвестно
/ShowFeaturedOptInDialog — неизвестно
/DemoUI — Показывает значок в трее — диалог настройки расписания установки обновлений или установки в зависимости от статуса
Всё это можно запускать из коммандной строки на удалённых хостах:
Winrs -r:hostname wuauclt /detecnow
Такая ситуация. Хост с виртуальными машинами в числе 100шт. VHD каждой занимает 7.3Гб(Диски динамические до 15Гб). Объём хранилища 815Гб. 7.3 * 100 = 730Гб. Хватает и памяти тоже, но не о ней разговор сейчас. Создаём. Вдруг свободное место на мастер машине начинает стремительно уменьшаться. Паника, из за нехватки места все машины паузятся.
Решением было отключить Windows Update на виртуальных машинах (дыра в безопастности, но для решения поставленной задачи это допускалось) Отключение через GUI это легкотня, вот только на 100 штуках не очень. Решаю останавить службу:
А потом и вовсе запретить ей старт:
sc config wuauserv start= disabled
Disable or Enable Windows Automatic updates from command line
We can disable Windows automatic updates from command line using the below command.
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 Widows 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.
If you want to download updates but not install till the user acts on it then you can set the registy value to 3.
If you want to disable Automatic updates service then run the below command.
IF you want to stop Automatic updates service then run the below command.
Command for starting automatic updates service:
Command for enabling the service:
Errors
In Vista/Windows 7, the above commands should be run from elevated administrator command prompt. Otherwise you would get the following error.
Thanks for the tip.. I tried this on Windows 7 and it worked perfectly. Thanks again.
thanks mate. one question, does this command only disable? or does it enable and disable?
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.
and 3 means Download udates but do not install
Thank you so much!! Saved me from infinite looping on Vista Ultimate with automatic updates.
Glad that the tip helped you..keep visiting the blog for many more tips..thank you..
How to check if windows automatic update is on?
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
Run cmd as administrator
It works very perfectly.
Sweet. This worked perfectly and all on a remote machine in another country…. I just fell in love with psexec again…
Tested on Windows 8, works perfectly, went over a nasty virus that destroyed my admin access for many things such as Windows Update (can’t be eliminated without formatting the computer and I can’t afford to lose my programs).
Does nothing. According to the windows update page on control panel it says its still on auto update. And I can’t turn it off from there thats why I wanted a alternative like this.
sounds like id-10-t error ….
I have tested this on Windows 10 Technical Preview and it can disable and stop the windows update service – will not issue
in this one the options are locked and the update have to be on all the time.
The last update keeps going to error: DPC Watchdog Violation and meant i had to keep rolling back my Laptop for it to work
Now i have no issue as the upated are fully disable and not running any more lol
If you use this on Windows 10 Tech Preview: Run CMD in Admin for it to work…
I’m looking at Windows 7 and 10 and the value for automatic install of updates is 4, not zero. Zero is disabled. I’ve tested this myself by manually changing the setting and looking at the change in the registry.
Wondering if there is a way to have it NOT download and install IE 11. We have a client that runs software that is not compatible with that. They have close to 500 machines and for some reason their Corporate IT lets them slide on doing updates and rebooting. Ive got around 300 of those machines that need updates ran and this makes it much more time effective than calling each user and remoting into their machine.
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.
How to stop Windows update service
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.
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