Here is what I use.

In my package source folder, I have subfolders for 32bit and 64bit and I place 
my MSU files in the appropriate folder.

[cid:[email protected]]
The VBScript accepts a command line parameter (either “32” or “64”) that 
directs it to use the intended folder.  It then enumerates the MSU and installs 
them in order.

It’s a little heavy-handed but it gets the job done.  I have it running in our 
build task sequence and we have at times used it to push MSUs out to our 
machines.

Here is the script:
SET objArgs = WScript.Arguments

IF objArgs.Count < 1 THEN
                WScript.Echo "No arguments were used"
                WScript.Echo "Usage: Installmsu.vbs 32 / 64"
                WScript.Echo "Using 32bit by default"
                oArch = 32
ELSE
                oArch = objArgs(0)
END IF


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




Wscript.Echo 
"============================================================================"
WScript.Echo "Argument Passed: " & oArch

SELECT CASE oArch
                CASE "32"
                                oMSUSrc = "32bit"
                CASE "64"
                                oMSUSrc = "64bit"
                CASE ELSE
                                oMSUSrc = "32bit"
END SELECT


Set objfso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
sFolder = 
left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName)))
 & oMSUSrc & "\"
Set folder = objfso.GetFolder(sFolder)
Set files = folder.Files



WScript.Echo "MSU folder to use: " & oMSUSrc
Wscript.Echo 
"////////////////////////////////////////////////////////////////////////////"
WScript.Echo "Processing...."

  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)
      'iRetVal = 0
      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

WScript.Echo "Finished Processing."
Wscript.Echo 
"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
WScript.Echo "Done!"
Wscript.Echo 
"============================================================================"





From: [email protected] [mailto:[email protected]] On 
Behalf Of Marable, Mike
Sent: Thursday, January 07, 2016 6:22 AM
To: [email protected]
Subject: Re: [mssms] .msu packages

I have a script that enumerates a folder of MSU files and installs them.

I can send you more info once I get into work later this morning.  Right now 
it’s time to make the coffee. ;-)

Mike

From: <[email protected]<mailto:[email protected]>> 
on behalf of Krishna Mohan <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, January 6, 2016 at 10:17 PM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [mssms] .msu packages

Hi All,

Does anyone have idea on how to bundle multiple .msu files to single package 
and deployment? Please share if anyone have steps.




**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be 
used for urgent or sensitive issues

**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be 
used for urgent or sensitive issues 

Reply via email to