Solved

Installing locally multiple patches

Posted on 2007-03-29
11
243 Views
Last Modified: 2013-11-25
I would like to write up a fully working script that will install "all" MS 2003 patches within a specified directory (locally) and it should have /quiet /norestart options for all patches. The script should not care the naming convention of the .exe files. It should only care if there are .exe files, it should execute those with /q /n parameters.

The script could be written in vbscript or batch
@echo off
setlocal
set PATHTOFIXES=Drive:\update
%PATHTOFIXES%\*.exe /quiet /norestart
%PATHTOFIXES%\*.exe /quiet /norestart

0
Comment
Question by:onebulgar
  • 6
  • 4
11 Comments
 
LVL 14

Assisted Solution

by:Burns2007
Burns2007 earned 30 total points
ID: 18821175
@echo off
setlocal
set PATHTOFIXES=Drive:\update
dir %PATHTOFIXES%\*.exe /b >patches.txt
for /f "eol=; tokens=1*" %%i in (patches.txt) do (
%%i /quiet /norestart
)



This will export everything *.exe from "Drive:\update" to a text file, ti will then go through the text file lline by line and run
line1.exe /quiet /norestart
line2.exe /quiet /norestart
etc etc
0
 

Author Comment

by:onebulgar
ID: 18821368
It creates the file  (pathces.txt) but it says "File Not Found" when I run it from cmd.
0
 

Author Comment

by:onebulgar
ID: 18821376
Nevermind, my mistake. One last related question, what if file is called "patch sf3.exe" instead of patchsf3.exe. Currently, it will not work.

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 30

Expert Comment

by:SteveGTR
ID: 18821503
No points to me.

Just quote the executable:

"%%i" /quiet /norestart
0
 

Author Comment

by:onebulgar
ID: 18821509
As a matter of fact, I just tried the script and it didn't work. I says, "xyz.exe is not recongized as an internal
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 18821517
Well then, how about this. Note, I replaced Drive with C for this batch file. You'll want to change it as necessary.

@echo off

setlocal

pushd "c:\update"

for /f "tokens=*" %%a in ('dir /b /a-d *.exe 2^>NUL') do "%%a" /quiet /norestart

popd
0
 

Author Comment

by:onebulgar
ID: 18821521
SteveGTR: You are right :)

to finish my previous email,...."xyz.exe is not recongized as an internal or external command, operable program or batch file." This happens when I run the script from the cmd. Ah! it is so close to being done!

0
 

Author Comment

by:onebulgar
ID: 18821532
You are the man Steve!

You got the points but, would it be possible if you can echo what it is doing....?

Thanks
0
 
LVL 30

Accepted Solution

by:
SteveGTR earned 220 total points
ID: 18821535
@echo off

setlocal

pushd "c:\update"

for /f "tokens=*" %%a in ('dir /b /a-d *.exe 2^>NUL') do echo Running %%a&"%%a" /quiet /norestart

popd
0
 

Author Comment

by:onebulgar
ID: 18821584
Thanks! SteveGTR and Burns2007
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 18821588
Glad it worked :)
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can I modify this Excel worksheet with a script? 15 82
Windows batch files 3 52
Batch script needed for same file name but different file types 4 50
Batch File tool box 5 50
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…
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 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