RSS Feed

Batch install hotfixes for Windows XP

Posted on

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:\temp
dir /o /b /s *.exe > c:\temp\temp.txt
for /f %%i in (c:\temp\temp.txt) do %%i /passive /norestart
del 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:
1) Make a directory “c:\temp”
2) 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”
3) 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.
4) Finally, delete the “temp.txt”

Advertisements

About Allen Choong

A cognitive science student, a programmer, a philosopher, a Catholic.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: