Use of UsoClient on batch script to perform automatic udpates of Windows Servers

E

Efazenda

Dear all,



I am trying to write a script (batch script) which will be called by a schedule tasks on a Windows Server that will perform Scan / Download / Install and Restart.





REM WaitTime 5 minute (600 sec)

SET WaitTime=600




REM Scan Updates

%systemroot%\system32\UsoClient.exe StartScan



REM Wait scan to complete

timeout /t %WaitTime%




REM Download updates

%systemroot%\system32\UsoClient.exe StartDownload




REM Wait Download to complete

timeout /t %WaitTime%




REM Install updates

%systemroot%\system32\UsoClient.exe StartInstall




REM Wait Install to complete

timeout /t %WaitTime%




REM Restart Computer



The part of Scan / Download is working with the UsoClient.exe tool but not the StartInstall.

I see nothing on the events logs and nothing seems to happen.



Is this normal ?



I would run it on the following OS :



  • Windows Server 2012 R2
  • Windows Server 2016
  • Windows Server 2019



If you need more information on the context execution don't hesitate.



Best Regards, Edouard Fazenda.









Continue reading...
 
Back
Top Bottom