Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Installing locally multiple patches

Posted on 2007-03-29
11
Medium Priority
?
250 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
[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
  • 6
  • 4
11 Comments
 
LVL 14

Assisted Solution

by:Burns2007
Burns2007 earned 120 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
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 880 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

610 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