Dim WshShell, FSO Dim gTmpPath Set WshShell = CreateObject("WScript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") ' ************************************************************************* ' This function provides a temp path. To be used by the ExecuteCmd function. ' ************************************************************************* Function GetTempPath GetTempPath = WshShell.ExpandEnvironmentStrings("%TEMP%") & "\" End Function ' ************************************************************************* ' Executes a command and returns the text output ' ************************************************************************* Function doCmd(cmd) Dim exeOutput Dim sCmd Dim outFile, outFilename outFilename = gTmpPath & FSO.GetTempName sCmd = "%COMSPEC% /D /c " & cmd & " > " & outFilename 'Wscript.Echo sCmd exeOutput = WshShell.Run(sCmd, 0, True) 'Wscript.Echo exeOutput Set outFile = FSO.OpenTextFile(outFilename) doCmd = outFile.ReadAll outFile.Close FSO.DeleteFile(outFilename) End Function Dim cmdOut Dim path path = Wscript.ScriptFullName path = Left(path, inStrRev(path, "\")) 'Wscript.Echo path gTmpPath = GetTempPath() cmdOut = doCmd( """" & path & "PreReqChecker\omchecks.exe"" 2008_CORE 3 0" ) 'Wscript.Echo cmdOut 'get os name Dim regEx, Match, Matches ' Create variable. Dim lineRex, lineMatches Dim astr, found Set regEx = New RegExp ' Create a regular expression. Set lineRex = New RegExp regEx.Pattern = ".*\n" ' Set pattern. regEx.IgnoreCase = True ' Set case insensitivity. regEx.Global = True ' Set global applicability. lineRex.Pattern = "Status=\s*(\d+)" Set Matches = regEx.Execute(cmdOut) ' Execute search. For Each Match in Matches ' Iterate Matches collection. Set lineMatches = lineRex.Execute(Match.value) if lineMatches.count > 0 then 'Wscript.Echo lineMatches(0).SubMatches(0) astr = lineMatches(0).SubMatches(0) found = Cint(astr) exit For end if Next Dim sCmd, exeOutput Dim title, jCmd, jPath, jOut title = " Dell PowerVault Modular Disk Storage Manager" jCmd = path & "ia\jre\bin\java" jPath = path & "setup_java" jOut = " > """ & gTmpPath & "MD3000i_setup.txt"" 2>&1" if ( found = 3 ) then ' 3 is the core return value sCmd = "%COMSPEC% /C "" """& jCmd & """ -cp """ & jPath & """ setup """ & path & "\""" & jOut & """" else sCmd = "%COMSPEC% /C """ & path & "setup.exe""" end if 'Wscript.Echo sCmd exeOutput = WshShell.Run(sCmd, 0, True)