Archive

Archive for the ‘VB Script to Install msi and mst’ Category

VB Script to Install msi and mst

- I feel VB scripting is very Important for Application Packageres and SCCM Admins so I am writing this model script to help our community

Example 1

Option Explicit

Dim objShell, objFSO, SystemDrive, Exitcode

Set objFSO = CreateObject(“Scripting.FileSystemObject”)

Set objShell = CreateObject(“WScript.shell”)

SystemDrive = objShell.ExpandEnvironmentStrings(“%SYSTEMDRIVE%”)

If objFSO.FolderExists(SystemDrive & “\Temp\Logs”) Then

‘Wscript.Echo “Folder does exist”

Else

objFSO.CreateFolder SystemDrive & “\Temp”

objFSO.CreateFolder SystemDrive & “\Temp\Logs”

End If

Exitcode = objShell.Run(“msiexec /i ” & Chr(34) & “WAAS.msi” & Chr(34) & ” TRANSFORMS=” & Chr(34) & “AcceleNet_3_5_4_3.mst” & Chr(34) & ” /quiet /passive /norestart /L*v ” & Chr(34) & SystemDrive & “\Temp\logs\AcceleNet_3_5_4_3.log” & Chr(34), 1, True)

Wscript.Quit(Exitcode)

Example 2 (MSI MST WITH PATCH)

Option Explicit

Dim objShell, objFSO, SystemDrive, Exitcode

Set objFSO = CreateObject(“Scripting.FileSystemObject”)

Set objShell = CreateObject(“WScript.shell”)

SystemDrive = objShell.ExpandEnvironmentStrings(“%SYSTEMDRIVE%”)

If objFSO.FolderExists(SystemDrive & “\Temp\Logs”) Then

‘Wscript.Echo “Folder does exist”

Else

objFSO.CreateFolder SystemDrive & “\Temp”

objFSO.CreateFolder SystemDrive & “\Temp\Logs”

End If

objShell.Run “msiexec /i ” & Chr(34) & “AdbeRdr1010_en_US.msi” & Chr(34) & ” TRANSFORMS=” & Chr(34) & “AdbeRdr1010_en_US.mst” & Chr(34) & ” /qB /L*v ” & Chr(34) & SystemDrive & “\Temp\logs\AdbeRdr1010_en_US.log” & Chr(34), 1, True

objShell.Run “msiexec /P ” & Chr(34) & “AdbeRdrUpd1014.msp” & Chr(34) & ” /qb REINSTALL=ALL REINSTALLMODE=VOMUS /L*v ” & Chr(34) & SystemDrive & “\install\logs\AdbeRdrUpd1014.log” & Chr(34), 1, True

objShell.Run “cmd.exe /c REGEDIT /S Policies.reg”, 0, True

objShell.Run “cmd.exe /c REGEDIT /S ARM.reg”, 0, True

Wscript.Quit(Exitcode)

Example 3 (PATCH ONLY .MSP FILE)

Option Explicit

Dim objShell, objFSO, SystemDrive, Exitcode, WshShell, OsType

Set objFSO = CreateObject(“Scripting.FileSystemObject”)

Set objShell = CreateObject(“WScript.shell”)

Set WshShell = CreateObject(“WScript.Shell”)

SystemDrive = objShell.ExpandEnvironmentStrings(“%SYSTEMDRIVE%”)

OsType = WshShell.RegRead(“HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE”)

If objFSO.FolderExists(SystemDrive & “\Temp\Logs”) Then

‘Wscript.Echo “Folder does exist”

Else

objFSO.CreateFolder SystemDrive & “\Temp”

objFSO.CreateFolder SystemDrive & “\Temp\Logs”

End If

If OsType = “x86″ then

objShell.Run “msiexec /P ” & Chr(34) & “AdbeRdrUpd1014.msp” & Chr(34) & ” /qb REINSTALL=ALL REINSTALLMODE=VOMUS REBOOT=ReallySuppress /L*v ” & Chr(34) & SystemDrive & “\Temp\logs\AdbeRdrUpd1014.log” & Chr(34), 1, True

Wscript.quit

elseif OsType = “AMD64″ then

objShell.Run “msiexec /P ” & Chr(34) & “AdbeRdrUpd1014.msp” & Chr(34) & ” /qb REINSTALL=ALL REINSTALLMODE=VOMUS REBOOT=ReallySuppress /L*v ” & Chr(34) & SystemDrive & “\Temp\logs\AdbeRdrUpd1014.log” & Chr(34), 1, True

Wscript.quit(Exitcode)

end if

Wscript.Quit(Exitcode)

SavillTech's Blog

Just another WordPress.com site

IT And Management by Abheek

Microsoft certified Trainer -Abheek

Andrewdcraig's SCCM Blog

Looking at pre-requisites for SCCM deployments with Powershell

Boerlowie's Blog

Blog about VMware, PowerShell, PowerCLI, Active Directory, Exchange, SQL, ...

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Cameron Fuller

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Adam Rafels

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

IT Consultant Everyday Notes

Just some problems/solutions storage

System Center Solutions

All About: Software Application Packaging & SCCM Administration & VMWare Administration

SCCM Packager

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Srikanth Boddupalli

The greatest WordPress.com site in all the land!

Tao Yang's System Center Blog

My thoughts on System Center, PowerShell and more...

Kirx' Blog

Kirx' Application Virtualization Blog

"MsiRevolution"

This site is completely related to the application packaging. In this site, you can find the information about the Windows Installer(MSI), Application Virtualisation and VB Scripting which will be useful for the application packagers. If any one faces the issues, please post in this site, we will try to get back to you with appropriate solutuion

All About: Software Application Packaging & SCCM Administration & VMWare Administration

just another windows noob ?

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

MSIwisdom

All About: Software Application Packaging & SCCM Administration & VMWare Administration

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Site Home

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Site Home

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Site Home

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Site Home

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Site Home

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Aaron Parker

on application delivery and end user computing

Felipe Binotto's Blog

All About: Software Application Packaging & SCCM Administration & VMWare Administration

Anoops

SCCM ConfigMgr A blog about Infrastructure Management

windowsmasher

Just another WordPress.com site

ESwar KONeti's

All about Configmgr and its Connected Objects....

Follow

Get every new post delivered to your Inbox.