Batch install hotfixes for Windows XP
Since Windows XP Service Pack 3 released, we might need to install the critical hotfixes ourselves. There are several ways to install hotfixes. We can search for “windows offline update” from internet.
But, I personally prefer go to The Software Patch, and download manually. Because I can download whatever I like. However, installing those hotfixes manually is troublesome. Then I wrote a batch file to install the hotfixes automatically. But I need to update the batch file whenever I download new hotfixes. Finally, I found a good solution.
I wrote a batch file as following:
if not exist c:\temp mkdir c:\tempdir /o /b /s *.exe > c:\temp\temp.txtfor /f %%i in (c:\temp\temp.txt) do %%i /passive /norestartdel c:\temp\temp.txt
And put this batch file under the same directory with the hotfixes. Run it, everything okay.
I will explain the algorithm:
- Make a directory “c:\temp”
- Display all *.exe within the current directory. Assuming there are only hotfixes .exe, no other .exe files. And save the list of .exe to “c:\temp\temp.txt”
- Read the “c:\temp\temp.txt”, for every line of the temp.txt is a hotfix .exe file, then run the .exe with the parameter “passive” and “norestart”, so that silent installation without restart is performed.
- Finally, delete the “temp.txt”