Solved

Installing locally multiple patches

Posted on 2007-03-29
11
242 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

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

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

11 Experts available now in Live!

Get 1:1 Help Now