Solved

Using a FOR Loop to install multiple patches

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
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…

732 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