/build/static/layout/Breadcrumb_cap_w.png

Windows management framework 5.1 (for 2012 r2 server) - how to install this .msu file by using vb script

i tried like this, but it is wrong


'Option Explicit
On Error Resume Next

'**************Declaration*********************************
Dim sCurrentDir,  strFolder, wshell, sysDir, objEnv, strLogName, regValPath,regValPath1
Dim colProcessList, objWMIService, oShell, strLogPath, strRC, strCmd, strDwordName, dwValue, strDwordName1, dwValue1
Dim oArgs, arrSubKeys(), blnChkInstall, objLogFile, strLogName1, objLogFile1
Dim objFSO,strComputer,oReg, MainKey, subkey, strKeyPath, strValueName,strValue


Set oShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set oArgs = WScript.Arguments
Set wshell = CreateObject("WScript.Shell")
Set objEnv = oShell.Environment("PROCESS")
sysDir = wshell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")

strComputer = "."

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

const HKEY_LOCAL_MACHINE = &H80000002
const sPackageName = "Microsoft_WMF_5.1_P1.0"
Const strDispName = "WMF 5.1"
Const strDispVer = "5.1"
Const strProdCode = "{3B7E914A-93D5-4A29-92BB-AF8C3F66C431}"
Const strLogFile = "Microsoft_WMF_5.1_P1.0_EXEinstall.log"

'********************************************************************************************
' ----------------------------------------------------------------------------------------------------------------
' CASE "install" **** Install main application silently ****
' ----------------------------------------------------------------------------------------------------------------
Case "install"
'-- Install application silently --
            Log "Starting install log of Package: " & sPackageName
             
Log "Continuing with the installation of WMF 5.1...."
Call (oShell.Run("wusa.exe""" & sCurrentDir & "Win7AndW2K8R2-KB3191566-x64.msu" & """" & " /quiet /norestart /l*v " & sysDir & "\bc_logs\Microsoft_WMF_5.1_P1.0_install.log",1,True))


Log "Calling CheckVersion WMF 5.1 sub."
CheckVersion strProdCode,strDispName,strDispVer,blnInstalled
Log "Ending CheckVersion WMF 5.1 sub."
 
 If blnInstalled Then
 Log sPackageName & " Installed successfully."
 WScript.Quit(0)
 Else
 Log sPackageName & " Failed to install on this machine."
 WScript.Quit(911)
 End If 
 
End If
End If
' ----------------------------------------------------------------------------------------------------------------
' CASE "Uninstall" **** UnInstall main application silently ****
' ----------------------------------------------------------------------------------------------------------------

Case "uninstall"
OShell.Run "wuse.exe /KB3191566" & " /uninstall /quiet /norestart /l*v " & sysDir & "\bc_logs\Microsoft_WMF_5.1_P1.0_uninstall.log"

' ----------------------------------------------------------------------------------------------------------------
' CASE "OTHER THAN INSTALL/UNINSTALL **** No action required ****
' ----------------------------------------------------------------------------------------------------------------

Case Else
WScript.Quit
End Select

Else
WScript.Quit
End If


0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ