Solved

Using a FOR Loop to install multiple patches

Posted on 2009-05-10
4
756 Views
Last Modified: 2012-05-06
I have a location where the OS install files are located and want to slipstream these patches. Can you help me for a LOOP which would treat any number of these hotfixes exactly like the four examples below.
(Some kind of FOR Loop which would target all the patches in the %patchpath%)
Or maybe Powershell or VBS would be better?
Thank you!
JohnD
set baseXPpath=X:\i386

set patchpath=X:\i386\patches

%patchpath%\WindowsXP-KB834707-x86-enu.exe /integrate:%baseXPpath%

%patchpath%\WindowsXP-KB885836-x86-ENU.exe /integrate:%baseXPpath%

%patchpath%\WindowsXP-KB873339-x86-ENU.exe /integrate:%baseXPpath%

%patchpath%\WindowsXP-KB885835-x86-ENU.exe /integrate:%baseXPpath%

Open in new window

0
Comment
Question by:johndarby
  • 2
  • 2
4 Comments
 
LVL 95

Accepted Solution

by:
Lee W, MVP earned 500 total points
ID: 24351095
First, why not use nLite to do this?  www.nliteos.com

Put the Patch Names into a text file - for example:

Patches.txt:
-------------------
WindowsXP-KB834707-x86-enu.exe /integrate:%baseXPpath%
WindowsXP-KB885836-x86-ENU.exe /integrate:%baseXPpath%
WindowsXP-KB873339-x86-ENU.exe /integrate:%baseXPpath%
WindowsXP-KB885835-x86-ENU.exe /integrate:%baseXPpath%
-------------------

Then the batch file would be as below:
set baseXPpath=X:\i386

set patchpath=X:\i386\patches

for /f "tokens=*" %%a in (patches.txt) Do %patchpath%\%%a

Open in new window

0
 
LVL 1

Author Comment

by:johndarby
ID: 24351206
Very cool tool (nLite)! I want to have portability for working from a USB stick and the script above is helpful. Do I need to add the /INTEGRATE switch as well, like this...

set baseXPpath=X:\i386
set patchpath=X:\i386\patches
for /f "tokens=*" %%a in (patches.txt) Do "%patchpath%\%%a /integrate:X:\i386"
0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 24351242
Honestly, don't know - I've only occasionally bothered creating a slipstreamed install (most of my clients get machines one at a time and maintaining an image for them doesn't generally make sense - and licensing prohibits me from creating a disk to use at multiple clients.  And when I have created the slipstreamed CDs, I've used nLite.
0
 
LVL 1

Author Closing Comment

by:johndarby
ID: 31580010
A great help with the FOR loop! Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now