Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Batch script to install Updates Takes Forever!


  • Please log in to reply
18 replies to this topic

#1
XenonKilla

XenonKilla

    Newbie

  • Member
  • 18 posts
  • Joined 22-April 13
  • OS:Windows 7 x86
  • Country: Country Flag
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, 24 April 2013 - 10:16 PM.



How to remove advertisement from MSFN

#2
DosProbie

DosProbie

    Friend of MSFN

  • MSFN Sponsor
  • 747 posts
  • Joined 16-October 12
  • OS:Windows 8.1 x64
  • Country: Country Flag

Donator

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, 25 April 2013 - 01:58 AM.


#3
XenonKilla

XenonKilla

    Newbie

  • Member
  • 18 posts
  • Joined 22-April 13
  • OS:Windows 7 x86
  • Country: Country Flag
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, 25 April 2013 - 06:15 AM.


#4
DosProbie

DosProbie

    Friend of MSFN

  • MSFN Sponsor
  • 747 posts
  • Joined 16-October 12
  • OS:Windows 8.1 x64
  • Country: Country Flag

Donator

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

#5
XenonKilla

XenonKilla

    Newbie

  • Member
  • 18 posts
  • Joined 22-April 13
  • OS:Windows 7 x86
  • Country: Country Flag

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 :)

#6
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
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, 28 April 2013 - 09:50 AM.

Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#7
XenonKilla

XenonKilla

    Newbie

  • Member
  • 18 posts
  • Joined 22-April 13
  • OS:Windows 7 x86
  • Country: Country Flag

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.

#8
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

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.
Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#9
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
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, 03 May 2013 - 10:57 PM.

Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#10
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
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.
Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#11
bphlpt

bphlpt

    MSFN Addict

  • Member
  • PipPipPipPipPipPipPip
  • 1,798 posts
  • Joined 12-May 07
  • OS:none specified
  • Country: Country Flag
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

Posted Image


#12
XenonKilla

XenonKilla

    Newbie

  • Member
  • 18 posts
  • Joined 22-April 13
  • OS:Windows 7 x86
  • Country: Country Flag

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, 05 May 2013 - 10:37 PM.


#13
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,543 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

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:



#14
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

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
Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#15
XenonKilla

XenonKilla

    Newbie

  • Member
  • 18 posts
  • Joined 22-April 13
  • OS:Windows 7 x86
  • Country: Country Flag

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, 07 May 2013 - 07:32 PM.


#16
mikesw

mikesw

    Advanced Member

  • Member
  • PipPipPip
  • 365 posts
  • Joined 05-October 05
'll need to disable AVAST to see if this cuts down on my 2 hours on 2ghz machine to integrate 132 w7 x32 patches. Don't forget to disable the auto defragger running in the background too.


If one is creating an AIO, there are 5 OS' at 2 hours a pop to integrate... Sigh!!!

Can dism integrated MSI's vs. just exes?
What about dot Net full/patches, windows media player full/patcches, messenger/communicator etc?

#17
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
DISM can install only .cab files (Example: extracted .exe like Internet Explorer 10), .msu files, and .inf files (example: Driver files extracted). Microsoft System Installer system .msi files must be installed online by using OCSetup
http://technet.micro...6(v=ws.10).aspx

Edited by maxXPsoft, 09 May 2013 - 12:54 AM.

Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#18
XenonKilla

XenonKilla

    Newbie

  • Member
  • 18 posts
  • Joined 22-April 13
  • OS:Windows 7 x86
  • Country: Country Flag
For Clean Installs, I've created an AIO Thumbdrive that has WIndows 7 x86, x46, and Server 2008 R2 which has all current updates already slipstreamed into the AIO WIM.

For systems with Windows already installed I have a folder with updates where I can just run a batch file to process the updates manually.

For NET Framework updates I keep a separate folder with those updates and process those via batch file as well.

Dam PITA Updates :wacko:

Edited by XenonKilla, 10 May 2013 - 06:24 PM.


#19
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
I created an MSE disable/shutdown autoit script I can call in my cmd files. That works like a charm
still working trying to improve right now

Attached File  mseoff.png   10.83KB   9 downloads
Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users