Installing multiple Windows 7 hotfixes(.msu) with SCCM

Sometimes you want to deploy more that one Windows 7 hotfix with Configuration Manager. The hotfixes for Windows 7 is .MSU files and are installed using Wusa.exe.
If you wan to make the hotfix installation silent you simply add /quiet /norestart on the command line aswell.

Example command line: Wusa.exe c:\temp\Windows6.1-KB982018-v3-x64.msu /quiet /norestart

To simplify the installation I have made a small script the will parse all the files in the same directory as the script and install all files which ends with .MSU automatically. It can both be used to distribute the hotfixes using software distribution or in a Task Sequence so you can install the updates during OSD.

multiple_msu
To use it simply save the script in the same folder as you Windows 7 hotfixes you want to deploy and then create a package and program with the folder as package source and the command line configured as below.

multiple_msu1

I strongly recommend that you allow configuration manager to restart the computer, otherwise the user can be prompted by the Windows Update agent to restart within 10  minutes.

If you need to troubleshoot it run it with allow user to interact, then you will see the updates being displayed in a command prompt.

Installmsu.vbs script:

Dim objfso, objShell

Dim folder, files, sFolder, folderidx, Iretval, return

Set objfso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
sFolder = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName)))
Set folder = objfso.GetFolder(sFolder)
Set files = folder.Files
For each folderIdx In files
If Ucase(Right(folderIdx.name,3)) = "MSU" then
wscript.echo "wusa.exe " & sfolder & folderidx.name & " /quiet /norestart"
iretval=objShell.Run ("wusa.exe " & sfolder & folderidx.name & " /quiet /norestart", 1, True)
If (iRetVal = 0) or (iRetVal = 3010) then
wscript.echo folderidx.name & " Success"
Else
wscript.echo folderidx.name & " Failed"
wscript.quit(1)
End If
End If
Next

Dim objfso, objShell

Dim folder, files, sFolder, folderidx, Iretval, return

Set objfso = CreateObject("Scripting.FileSystemObject")

Set objShell = CreateObject("Wscript.Shell")

sFolder = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName)))

Set folder = objfso.GetFolder(sFolder)

Set files = folder.Files

For each folderIdx In files

If Ucase(Right(folderIdx.name,3)) = "MSU" then

wscript.echo "wusa.exe " & sfolder & folderidx.name & " /quiet /norestart"

iretval=objShell.Run ("wusa.exe " & sfolder & folderidx.name & " /quiet /norestart", 1, True)

If (iRetVal = 0) or (iRetVal = 3010) then

wscript.echo folderidx.name & " Success"

Else

wscript.echo folderidx.name & " Failed"

wscript.quit(1)

End If

End If

Next

17 Comments

Add a Comment

Your email address will not be published. Required fields are marked *