Jump to content

Script to force install all Windows Update/WSUS


Recommended Posts

Posted

Sorry if you've seen this before, but I've certainly seen the question unanswered on here a few times.

I've found a script that will automatically download and install updates from Windows update or internal WSUS. Great for new installs!

 

I edited it slightly so that it keeps restarting and running until all the updates are installed and once they are installed it will intiate the next part of our build process.

The original version is here:

http://www.wsus.info/forums/index.php?s=f34047dcf9abc1996c216d3948c70b56&showtopic=7298&st=0

  • Thanks 3
Posted

When it comes to network domains I always use WSUS. It makes a lot of sense, otherwise you'll be downloading the same Windows updates over the web multiple times. It's still relatively time consuming.

 

For standalone or offline installs, I have downloaded redistributable versions of Windows XP critical and optional updates (including Media Player 11, IE7, Remote Desktop 6, .NET Framework 1.1 + updates, .NET Framework 2.0 and .NET Framework 3.0) since XP SP2. I then created a batch file which will quietly install all updates one by one. Most are easy, although some required some googling as they use different switches.

 

It took me a while to create, but no doubt saves me a lot of time patching existing machines or new machines. Of course when XP SP3 arrives, I would create a slipstream disc, then create a new pack post SP3 updates.

Posted

This works with WSUS (or windows update) - all it does is automate the existing Windows Update client. It is not a collection of updates downloaded. It works with WSUS or WU makingn it 100% up to date.

 

The problem we had was that after XP had installed, machines would start downloading updates and then sit there until the designated install time or until I came along and selected 'Install Updates and Shutdown'. As some updates are dependant on other updates, you might need to do this 3 times.

Now, this script runs as part of our zero-admin setup. It forces the download of updates from WSUS and installs them straight away and restarts the computer for you. If you have automated the script, it can then run again, untill the computer is fully up to date. Not rocket science, I know, but something that can't be done in windows and something I've been looking for a script for for ages.

Posted

I understand what you're getting at, but within WSUS you can specify 'deadline' dates for updates, so if a client hasn't completed updating and rebooting, it will visually display a 3 or 4 minute countdown sequence to the user.

 

Users can then save their work and close any open applications, then reboot. I've never really had to enforce this however as WSUS installs updates quickly in my experience.

  • 2 months later...
Posted
Sorry if you've seen this before, but I've certainly seen the question unanswered on here a few times.

I've found a script that will automatically download and install updates from Windows update or internal WSUS. Great for new installs!

 

I edited it slightly so that it keeps restarting and running until all the updates are installed and once they are installed it will intiate the next part of our build process.

The original version is here:

http://www.wsus.info/forums/index.php?showtopic=7298&st=0

 

I see the original script, but I don't see your "edited" version.

Posted
It's not on that forum but I can post it if you like. It's rather crude and badly edited, with file names etc.. hard coded in, but you're welcome to it if you want.
Posted
It's not on that forum but I can post it if you like. It's rather crude and badly edited, with file names etc.. hard coded in, but you're welcome to it if you want.

 

Sure, if you don't mind. I'm at [email protected]. It's the looping code I'm trying to work out --which you have indicated you've solved.

  • 2 months later...
Posted

*shamelessly resurrects old thread*

 

I have an issue with one or two machines not picking up updates from WSUS. They were existing machines that were reformatted.

 

Will this script sort that, or are there other things is should so to ensure they appear in WSUS Admin and get updates properly? thx

Posted

Probably not. The script doesn't do anything other than kick windows into running the wupdate software and monitors what the windows software does.

I assume you've tried wuauclt /detectnow

I sometimes (~10% of the time) have trouble with the script not running on new installs. The reason is that the wsus settings haven't applied properly because group policy hasn't refreshed correctly, even though I do gpupdate /force /boot as part of my build process.

A running gpupdate a second time and reboot fixes it straight away, however.

 

Next time you have a problem computer take a look in the registry at:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\

If the settings aren't there that may be the problem.

 

Have you looked at c:\windows\windowsupdate.log

That may give some clues too.

  • 5 months later...
Posted
I would but, unfortunately, I have left the place where I was working when I wrote it and for some :doh: reason, I didn't get a copy. I'm in another country now but I might go back at xmas and retrieve my hours of labour!
  • 9 months later...
  • 4 months later...
Posted
When it comes to network domains I always use WSUS. It makes a lot of sense, otherwise you'll be downloading the same Windows updates over the web multiple times. It's still relatively time consuming.

 

For standalone or offline installs, I have downloaded redistributable versions of Windows XP critical and optional updates (including Media Player 11, IE7, Remote Desktop 6, .NET Framework 1.1 + updates, .NET Framework 2.0 and .NET Framework 3.0) since XP SP2. I then created a batch file which will quietly install all updates one by one. Most are easy, although some required some googling as they use different switches.

 

It took me a while to create, but no doubt saves me a lot of time patching existing machines or new machines. Of course when XP SP3 arrives, I would create a slipstream disc, then create a new pack post SP3 updates.

 

Hi,

 

I'm looking for a script to do exactly what you have described here!

 

Is there any chance you got it to work with SP3 updates?

  • 4 months later...
Posted

You can try to do this in a command line script with WuInstall, with the /download option.

 

Usually puts the downloads into the Windows\SoftwareDistribution\Download directory.

 

From there, you can copy them on every new machine and install them, for example with wuInstall /install.

 

Maybe in a future version it will also be possible to specify a certain download directory.

  • 1 year later...
Posted

Does anyone have a copy of the windows updates script WITH the looping code? I too am looking for a way to automate the update-reboot-update again sequence.

 

please post to this thread if you have the code.

 

many thanks

Posted
Hi,

 

I'm looking for a script to do exactly what you have described here!

 

Is there any chance you got it to work with SP3 updates?

 

I don't do any new installs of XP anymore, but this is what I wrote/used. You can just update this as required.

 

.NET Framework Script:

@echo off
setlocal
set PATHTOFIXES=C:\logistixonline.com\NET_Framework
TITLE Installing Microsoft .NET Framework 1.1, 2.0, 3.0, 3.5 + 4.0...
echo.
echo Installing .NET Framework 1.1 SP1...
start /wait dotnetfx1.exe /q:a /c:"install.exe /q"
echo.
echo Installing .NET Framework 1.1 SP1 Update 1...
start /wait NDP1.1sp1-KB867460-X86.exe /q /i
echo.
echo Installing .NET Framework 1.1 SP1 Update 2...
start /wait NDP1.1sp1-KB2416447-X86.exe /q /norestart
echo.
echo Installing .NET Framework 2.0 SP2...
start /wait dotnetfx2.exe /q:a /c:"install.exe /q"
echo.
echo Installing .NET Framework 3.0 SP2...
start /wait dotnetfx3.exe /q /norestart
echo.
echo Installing .NET Framework 3.5 SP1...
start /wait dotnetfx35.exe /q /norestart
echo.
echo Installing .NET Framework 2.0 SP2 Update 1...
%PATHTOFIXES%\NDP20SP2-KB979909-x86.exe /q /norestart
echo.
echo Installing .NET Framework 2.0 SP2 Update 2...
%PATHTOFIXES%\NDP20SP2-KB2418241-x86.exe /q /norestart
echo.
echo Installing .NET Framework 2.0 SP2 Update 3...
%PATHTOFIXES%\NDP20SP2-KB2446704-v2-x86.exe /q /norestart
echo.
echo Installing .NET Framework 2.0 SP2 Update 4...
%PATHTOFIXES%\NDP20SP2-KB958481-x86.exe /q /norestart
echo.
echo Installing .NET Framework 3.0 SP2 Update 1...
%PATHTOFIXES%\NDP30SP2-KB977354-v2-x86.exe /q /norestart
echo.
echo Installing .NET Framework 3.0 SP2 Update 2...
%PATHTOFIXES%\NDP30SP2-KB982168-x86.exe /q /norestart
echo.
echo Installing .NET Framework 3.0 SP2 Update 3...
%PATHTOFIXES%\NDP30SP2-KB958483-x86.exe /q /norestart
echo.
echo Installing .NET Framework 3.5 SP1 Update 1...
%PATHTOFIXES%\NDP35SP1-KB958484-x86.exe /q /norestart
echo.
echo Installing .NET Framework 3.5 SP1 Update 2...
%PATHTOFIXES%\NDP35SP1-KB963707-x86.exe /q /norestart
echo.
echo Installing .NET Framework 3.5 SP1 Update 3...
%PATHTOFIXES%\NDP35SP1-KB2416473-x86.exe /q /norestart
echo.
echo Installing .NET Framework 4.0...
start /wait dotnetfx4.exe /q /norestart
echo.
echo Installing .NET Framework 4.0 Update 1...
%PATHTOFIXES%\NDP40-KB2416472-x86.exe /q /norestart
echo.
echo Installing .NET Framework 4.0 Update 2...
%PATHTOFIXES%\NDP40-KB2518870-x86.exe /q /norestart
echo.
echo Installing .NET Framework 4.0 Update 3...
%PATHTOFIXES%\NDP40-KB2478663-x86.exe /q /norestart
echo.
PAUSE
EXIT

Posted

Windows XP SP3 Script:

@echo off
setlocal
TITLE Windows XP SP3 Post Hotfixes - logistixonline.com
set PATHTOFIXES=C:\logistixonline.com\XPSP3
TITLE Installing Microsoft Windows Internet Explorer 8
echo.
echo Installing IE8-WindowsXP-x86-ENU.exe...
%PATHTOFIXES%\IE8-WindowsXP-x86-ENU.exe /quiet /passive /norestart
echo.
TITLE Installing Windows Media Player 11
echo.
echo Installing Windows Media Player 11 Part 1...
%PATHTOFIXES%\wmfdist11.exe /quiet /passive /norestart
echo.
echo Installing Windows Media Player 11 Part 2... 
%PATHTOFIXES%\wmp11.exe /quiet /passive /norestart
echo.
echo Installing WindowsXP-KB941569-x86-ENU.EXE... 
%PATHTOFIXES%\WindowsXP-KB941569-x86-ENU.EXE /quiet /passive
echo.
TITLE Installing Adobe Flash 10.3.181.34
echo.
echo Installing Adobe Flash 10.3.181.34...
%PATHTOFIXES%\Flash-Flash-10.3.181.34.msi /quiet /norestart
echo.
echo Installing Adobe Flash 10.3.181.34 FF...
%PATHTOFIXES%\Flash-10.3.181.34-FF.msi /quiet /norestart
echo.
TITLE Installing Windows XP SP3 Post Hotfixes 
echo.
echo Installing WindowsXP-KB898461-x86-ENU.exe... 1 of 173
%PATHTOFIXES%\WindowsXP-KB898461-x86-ENU.exe /quiet /norestart
echo.
echo Installing WindowsXP-KB950760-x86-ENU.exe... 
%PATHTOFIXES%\WindowsXP-KB950760-x86-ENU.exe /quiet /norestart
echo.
echo Installing WindowsXP-KB950762-x86-ENU.exe...
%PATHTOFIXES%\WindowsXP-KB950762-x86-ENU.exe /quiet /norestart
echo.
PAUSE
EXIT

 

I can't upload the whole lot as it's too long I'm afraid, but you get the idea. Download Windows Updates, save them in a folder and update the script as required.

  • 1 year later...
Posted (edited)

There's at least one tool out there that handles the problem of installing Windows Updates remotely, including update + reboot cycle options, which enable you to do an automated loop of the installation and reboot process as many times as you want. The evaluation version is free and fully functional, though it limits the number of hosts you can do simultaneously.

 

Check it out: BatchPatch

Edited by d-edugeek

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • 47 When would you like EduGeek EDIT 2025 to be held?

    1. 1. Select a time period you can attend


      • I can make it in June\July
      • I can make it in August\Sept
      • Other time period. Comment below
      • Either time

×
×
  • Create New...