a little experiment with Windows update start/stop/disable in a single batch file: Code: @echo off color 1F set service=wuauserv sc query %service% | find "RUNNING" if "%ERRORLEVEL%"=="0" ( net stop %service% sc config %service% start= disabled ) else ( sc config %service% start= demand net start %service% ) timeout /t 2 sc query %service% >>TEMPmessage.txt msg %username% /time:20 <TEMPmessage.txt del TEMPmessage.txt /f /q exit any suggestions to improve the script are most welcomed.
maybe sc config %service% start= disabled || sc config %service% start= demand net stop %service% || net start %service%
just tried your script but the toggle "sc config" does not seem to work, only works with the "net" command. thanks for your input. when Windows update is stopped I want the service disabled.
You might add this, if the service is being started, to jump directly to checking for updates, even simulate pressing enter. The "en-us" part is dependable on your language version. %localappdata%\Packages\windows.immersivecontrolpanel_cw5n1h2txyewy\LocalState\Indexed\Settings\en-US\AAA_SystemSettings_MusUpdate_UpdateActionButton.settingcontent-ms