Jump to content

Batch script to install Updates Takes Forever!


Recommended Posts

On my Clean Windows 7 Installs I've been using a simple batch file which installs all my Windows Update MSU files. Problem is that this process seems to take FOREVER! By forever I mean over an hour to install 70 updates. If I use Windows Update to install the same 70 updates it only takes 20 minutes and that's including the time it took WU to download the updates AND install them! Also WSUS Offline only took about 25 minutes to install updates. All of these tests were done on a clean install of Win7SP1 x64. So I'm wondering if I'm doing something wrong or if there is a better approach to this process.

Here is the basic script I'm using to install the updates, it's very straightforward...


@echo off
echo %time%
echo.
wusa KB2479943.msu /quiet /norestart
wusa KB2491683.msu /quiet /norestart
wusa KB2506014.msu /quiet /norestart
wusa KB2506212.msu /quiet /norestart
wusa KB2506928.msu /quiet /norestart
echo.
echo%time%
pause

This is just a sample with 5 updates but the complete script contains about 70 updates which is taking well over an hour to complete!

I've already created slipstreamed builds with these updates which work just fine for clean installs. The reason I'm doing it like this is for my installs of NON-slipstreamed builds, so that I can install all critical updates without having to re-downloaded them every time. I don't wanna use WSUS Offline because it only installs Critical Updates and I want to install other updates in addition to the Critical Updates.

I've already tried disabling System Restore but to no avail. Just looking for some other ideas which would be causing the updates to take so long to install.

Edited by XenonKilla
Link to comment
Share on other sites


On my Clean Windows 7 Installs I've been using a simple batch file which installs all my Windows Update MSU files. Problem is that this process seems to take FOREVER! By forever I mean over an hour to install 70 updates. If I use Windows Update to install the same 70 updates it only takes 20 minutes and that's including the time it took WU to download the updates AND install them! Also WSUS Offline only took about 25 minutes to install updates. All of these tests were done on a clean install of Win7SP1 x64. So I'm wondering if I'm doing something wrong or if there is a better approach to this process.

Here is the basic script I'm using to install the updates, it's very straightforward...


@echo off
echo %time%
echo.
wusa KB2479943.msu /quiet /norestart
wusa KB2491683.msu /quiet /norestart
wusa KB2506014.msu /quiet /norestart
wusa KB2506212.msu /quiet /norestart
wusa KB2506928.msu /quiet /norestart
echo.
echo%time%
pause

This is just a sample with 5 updates but the complete script contains about 70 updates which is taking well over an hour to complete!

I've already created slipstreamed builds with these updates which work just fine for clean installs. The reason I'm doing it like this is for my installs of NON-slipstreamed builds, so that I can install all critical updates without having to re-downloaded them every time. I don't wanna use WSUS Offline because it only installs Critical Updates and I want to install other updates in addition to the Critical Updates.

I've already tried disabling System Restore but to no avail. Just looking for some other ideas which would be causing the updates to take so long to install.

Why don't you just consolidate all your updates instead of listing each one...

@echo off&color e && cls && Mode 60,4&title,  [ MULTI UPDATE INSTALLER ]

echo. Installing Windows Updates..Please Wait!

:: UPDATES
:: Scan and Echo files from the msu folder during install..
for /f "delims=" %%a in ('dir/b *.msu') do (
echo == Installing Updates == "%%a"
echo.
:: DELAY
ping -n 4 localhost 1>nul
echo.
:: INSTALL
start /wait wusa %%a /quiet /norestart
)
cls
echo ** DONE ** && ping -n 3 127.0.0.1>nul && exit

Edited by DosProbie
Link to comment
Share on other sites

Upon further investigating it looks like the issue was two things.

1) System Restore Enabled

2) Windows Update Enabled

I had disabled System Restore which was causing somewhat of a slow down. However the real issue was caused by the Windows Update running in the background. I had to disabled Windows Update by going into Windows Update settings -> Change Settings -> and selecting "Never Check for Updates". After disabling both items, everything installed in a timely manner. For some reason I guess Windows Update was causing a conflict when trying to manually install updates while it was enabled.

BTW, I am using a batch script that does recursive folder search for MSU files and installs them. However to keep things simple I just used that basic script to test with. Didn't wanna complicate the situation anymore than necessary :D

Thanks for the suggestion though :)

Edited by XenonKilla
Link to comment
Share on other sites

Yep, Windows Update will pop-up when doing that many updates and bog you down.. Question have you done a boot time test before updates then boot time test after all your update installs??

Yeah you're exactly right. I kept seeing that "Reboot Reminder" window popup and it made me think that WU might be causing some kinda hangup.

What do you mean a "boot time" test? Like test to see how long it takes to boot the system on a clean install vs one that has been updated? I'm testing in VMWare Workstation and I just keep jumping back and forth between snapshots. But if you're curious about something let me know and I'll test it out and post back some results :)

Link to comment
Share on other sites

I inject the many updates 103 Hotfix(s) Installed into my wim and it takes a long time like an hour or so with the Right Click .wim. I then use same wim for awhile only adding the recent updates which don't take long

After awhile I add the recent to the long list.

I've been trying to figure out how to get Dism to run in a high priority when doing my long list but haven't figured that out yet

Edited by maxXPsoft
Link to comment
Share on other sites

I inject the many updates 103 Hotfix(s) Installed into my wim and it takes a long time like an hour or so with the Right Click .wim. I then use same wim for awhile only adding the recent updates which don't take long

After awhile I add the recent to the long list.

I've been trying to figure out how to get Dism to run in a high priority when doing my long list but haven't figured that out yet

I've actually created a batch script which uses DISM to integrate the updates. The main part of the script that does all the integrating is...

dism /Image:%mnt% /Add-Package /PackagePath:%updates%

I've got the following amount of updates that I currently integrate...

Win7 x86: 104 Updates

Win7 x64: 103 Updates

Server2008 R2: 96 Updates

Takes about 20 minutes per OS Version to integrate updates this way.

Link to comment
Share on other sites

Takes about 20 minutes per OS Version to integrate updates this way.

I don't see how 20 minutes. :no: My PC not that sloppy either 3.40 Ghz 8gb ram with a 7.4 WEI score

Don't matter what cmd script you use, all the same commands with Dism. I've even tried startx.exe /HIGH

I shutdown WU, disabled services and rebooted

I have Win 7 64 also and only 94 updates that will inject and it still over an hour.

Link to comment
Share on other sites

Anyone else?

When you inject updates say like 100 how long does it take?

Tried again with 94 and even Start /high /wait C:\Windows\System32\Dism.exe /image:D:\zMountdir /Add-Package /Packagepath:D:\APPS\__Updates\x64_msu

Start Time 12:58 PM

Finish Time 02:22 PM

Edited by maxXPsoft
Link to comment
Share on other sites

94 Updates Add-Package

Start: 12:05:52.18

Finish: 12:24:10.20

Turns out it was the Microsoft Security Essentials x64 sucking the life out of my PC. I was even using TASKKILL /F /IM msseces.exe at start of the cmd file. Trying to see what else I need to TASKKILL to improve performance or try a different anti-virus.

Link to comment
Share on other sites

From what I have seen, no matter which method or tool you prefer to use to make an OS build, it seems it is always best to temporarily disable any anti-virus and anti-malware app that you have installed. Some just cause poor performance, as you have noted, and others can sometimes cause mysterious errors that might not show up until you try to install the OS. Disconnect from the internet if you are concerned, in fact that might help you remember to re-enable your protection software afterwards.

Cheers and Regards

Link to comment
Share on other sites

94 Updates Add-Package

Start: 12:05:52.18

Finish: 12:24:10.20

Turns out it was the Microsoft Security Essentials x64 sucking the life out of my PC. I was even using TASKKILL /F /IM msseces.exe at start of the cmd file. Trying to see what else I need to TASKKILL to improve performance or try a different anti-virus.

Yup tried to tell you that it don't take that long. Why you think I started this thread? I don't know how that didn't dawn on you sooner having the AV turned on like that.

It's best to just DISABLE all of the following...

- AntiVirus

- System Restore

- Windows Update

Edited by XenonKilla
Link to comment
Share on other sites

It's best to just DISABLE all of the following...

- AntiVirus

- System Restore

- Windows Update

Is that marvellous advice
  • only if you intend to install updates from a batch script
  • if you intend to run any batch script
  • best practice for running Windows.

:wacko:

Link to comment
Share on other sites

Yup tried to tell you that it don't take that long. Why you think I started this thread? I don't know how that didn't dawn on you sooner having the AV turned on like that.

I've been around since pkgmgr.exe injecting updates. Early mse did not slow me down this bad. But I install a lot of software and a boatload of tweaks and modded files and such so I ididn't know if it was a combination of any of those. Only way is start clean and add things and test. It was plain and simple MSE was it alone cause restore is off cause I have an ssd and update was sitting there offering me something but I have it set ask. But I am injecting into install.wim

I just need to figure out how to send mse a cmd to disable

Link to comment
Share on other sites

It's best to just DISABLE all of the following...

- AntiVirus

- System Restore

- Windows Update

Is that marvellous advice
  • only if you intend to install updates from a batch script
  • if you intend to run any batch script
  • best practice for running Windows.

:wacko:

Are you insinuating that I was implying that those items should be left DISABLED all the time?

Yup tried to tell you that it don't take that long. Why you think I started this thread? I don't know how that didn't dawn on you sooner having the AV turned on like that.

I've been around since pkgmgr.exe injecting updates. Early mse did not slow me down this bad. But I install a lot of software and a boatload of tweaks and modded files and such so I ididn't know if it was a combination of any of those. Only way is start clean and add things and test. It was plain and simple MSE was it alone cause restore is off cause I have an ssd and update was sitting there offering me something but I have it set ask. But I am injecting into install.wim

I just need to figure out how to send mse a cmd to disable

Yeah I hear ya. I wouldn't have thought that having Windows Update set to check for updates would slow me down while installing either but yeah it was bogging me down almost as bad if not worse than what you described MSE as doing.

At least now you know though ;)

Edited by XenonKilla
Link to comment
Share on other sites

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...