Category filter

Script to download and install OS updates

It is imperative to download and install OS updates released by Microsoft as these updates might fix bugs and security flaws in your system. Using Hexnode, you can deploy scripts and effortlessly update the Windows devices to the latest version.


The sample scripts provided below are adapted from third-party open-source sites.

Batch script

The usoclient.exe commands do not provide any feedback on the terminal when executed manually or on the Hexnode portal if the script is deployed through the portal. The only way to ensure that the commands are working is to check if the updates are being downloaded under Settings > Update & Security > Windows Update on the devices.

PowerShell script

The device must have the PSWindowsUpdate module to initiate the OS update. The script below silently installs the PSWindowsUpdate module and then downloads the OS updates.


  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository