Windows Updates are very important and integral to the stability of the Windows operating system and considered very mandatory in many corporate companies as well as for consumers. Even though the Windows update is automatic, sometimes the Windows patches (KB updates) will not install automatically. In this post, we will show you how you can use a Batch file to download & install Windows Updates on Windows 10 computers.
Windows Updates often include feature enhancements and security updates to protect Windows from malware and malicious attacks. Windows Update can also be used to update drivers for popular hardware devices. Patches and other security updates are routinely released through Windows Update on the second Tuesday of every month – it’s called Patch Tuesday.
Use Batch file to download & install Windows Updates
To use a batch file to download and install Windows updates, follow the instructions outlined below.
To begin, you’ll need to make a note of the KB number which you want to install, then you have to create a batch file to download the Windows updates from the Microsoft Update Catalog.
- Head over to the Microsoft Update Catalog and search for the KB number which you want to download.
- Choose the correct patches/updates which is appropriate for your system architecture and operating system.
- Click on the Download button, then you will get a popup to download the package.
- Right-click on the msu link and copy the link. You’ll have to paste it accordingly in the script below.
- Open Notepad and copy-paste the script below. Make sure the KB numbers and the MSU link are replaced correctly as per your requirement.
@echo off cd/ echo "Downloading Patches; This will take several minutes depends on your Internet speed" powershell -Command "(New-Object Net.WebClient).DownloadFile('http://download.windowsupdate.com/c/msdownload/update/software/uprl/2020/03/windows-kb000000-x64-v5.81_74132082f1421c2217b1b07673b671ceddba20fb.exe', ' kb000000_Scan.exe')" echo "1 out of 4 downloaded" echo "****" powershell -Command "(New-Object Net.WebClient).DownloadFile('http://download.windowsupdate.com/c/msdownload/update/software/secu/2020/03/windows10.0- kb000000-x64_5db6cfc57a8bda4d13107ad24b3fe8fd790219cf.msu', ' kb000000.msu')" echo "2 out of 4 downloaded" echo "****" powershell -Command "(New-Object Net.WebClient).DownloadFile('http://download.windowsupdate.com/c/msdownload/update/software/secu/2020/04/windows10.0- kb000000-x64_705fda69935538eab5054d9d616e1761742816ec.msu', ' kb000000.msu')" echo "3 out of 4 downloaded" echo "****" powershell -Command "(New-Object Net.WebClient).DownloadFile('http://download.windowsupdate.com/d/msdownload/update/software/secu/2020/04/windows10.0- kb000000-x64_5411f88ea08bfc0ac98f388f5a3bdc8bcfea3261.msu', ' kb000000.msu')" echo "4 out of 4 are downloaded, Now installing patches!" echo "****" @echo off cd/ wusa.exe C:\ kb000000.msu /quiet /norestart echo " kb000000 is installed, processing the next one" echo "****" wusa.exe C:\ kb000000.msu /quiet /norestart echo " kb000000 is installed, processing the next one" echo "****" echo "This will take 5-10 mins for installing" echo "****" wusa.exe C:\ kb000000.msu /quiet /norestart echo "All the patches are installed & Your system is about to restart now" shutdown -r
Save the batch file as AutoUpdate.bat then copy and paste the file to the C drive and run the batch file in admin mode.
The first part of the script downloads the updates from the link which you have specified and the second part of the script installs the Windows updates.
IT administrators will find this script most helpful to install updates on multiple systems.
Read next: What is Windows 10 Update Servicing Cadence?