Solved

Using a FOR Loop to install multiple patches

Posted on 2009-05-10
4
755 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Utilizing an array to gracefully append to a list of EmailAddresses
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

19 Experts available now in Live!

Get 1:1 Help Now