Link to home
Start Free TrialLog in
Avatar of Sriram K
Sriram KFlag for India

asked on

Batch file fo rpatch installation


we will be installing patches manually on  windows server system due oto some issues with patcihng tool.

We are making a repository of applicaable windows pathces by dowloading them from internet(ms cataloger website) .

Can you please help with a batch file how to automate the installation.

Also, we find making a repository of   individual download from MS catalogue website time consuming and is there any   better or smart method to do this

Avatar of Michael B. Smith
Michael B. Smith
Flag of United States of America image

Window Software Update Services (WSUS). Windows Update For Business (WU4B). Windows Update. Microsoft Update. All of these are "free".

You don't describe the problem you are having, so I don't know why you wouldn't use one of the built-in solutions.

But once you've downloaded the patches, how you install them depends on the file extension. Just create a batch file that lists all the patches.

For exes:

start /wait file.exe /s

For MSUs and MSPs

start /wait  wusa file.msu /quiet /norestart

For MSIs

start /wait  msiexec file,msi /qn

And finish up with a reboot

shutdown -r -f -t 0

Push the batch file with GPO, psexec, Invoke-Command, or whatever tool you have available.
Avatar of Sriram K


Thanks may i Know what start /wait and /quiet  does  ,, while i understand /norestart please

Avatar of Michael B. Smith
Michael B. Smith
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks i understand now  how to create a batch file,  instead of writing all the .msuname ,
is there a way to call them  to the batch file.

Assuming traditional batch

for /f "usebackq" %%i in (`dir *.msu /b`) do @start /wait wusa %%i /quiet /norestart

Open in new window