SCCM 2012 - Installing multiple Windows 7 hotfixes(.msu) with SCCM

With SCCM if you need to create package to install .msu file you must use following syntax:

Wusa.exe c:\temp\FILExxxxx.msu /quiet /norestart

Otherwise you can use following script that will parse all the files in the same directory as the script and install all files which ends with .MSU automatically.


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



Original article:

http://ccmexec.com/2012/02/installing-multiple-windows-7-hotfixes-msu-with-sccm/