check windows update through a batch file

Copper Contributor


my loptop brand is  Asus Zenbook

and windows edtition is Microsoft Windows 11 Home OS Version: 10.0.22000 N/A Build 22000

i want a script file to check my windows update automatically 

if i explain you with details :my windows update works through going to setting>windows updatre and pushing check button

but i need a batch script to copy into my desktop and run it  to trigger win update button without going to setting


1 Reply
You don't need any batch file because by default whenever you connect to internet, Windows will automatically check for update and download and install it. You may run a quick test and just stay connect to internet without checking for update and you will see Windows will asking for update and you should see installed updates in the Windows Update history.
However, in case you are looking for script to do checking, it is easier to do it with Windows PowerShell.
You may open Windows PowerShell as administrator and then first import the Windows Update library with the following command:

Install-Module PSWindowsUpdate

The run the following command to check for update


And finally use the following command to install it: