Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using a FOR Loop to install multiple patches

Posted on 2009-05-10
4
Medium Priority
?
775 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 96

Accepted Solution

by:
Lee W, MVP earned 2000 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 96

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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

688 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