Multiple Cmd line args using vbscript
All I was trying to run this cmdline: "C:\Program Files\Common Files\InstallShield\Driver\1050\Intel 32\IDriver.exe" /M{AC568C0D-44AD-47B0-B21E-C303FE989C89} /uninst
Option Explicit
On Error Resume Next
Dim path, objFSO, WshShell, cmdln
path=CreateObject("WScript.Shell").ExpandEnvironmentStrings("%COMMONPROGRAMFILES%" & ("\InstallShield\Driver\1050\Intel 32\IDriver.exe"))
set objFSO=CreateObject("Scripting.FileSystemObject")
Set WshShell=WScript.CreateObject("WScript.Shell")
cmdln = (path & " " & ("/M{AC568C0D-44AD-47B0-B21E-C303FE989C89}") & " " & ("/uninst"))
MsgBox(cmdln)
If objFSO.FileExists(path) = True Then
WshShell.Run("""" & cmdln & """")
Set WshShell = Nothing
End If
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
anonymous_9363
13 years ago
Too many brackets and quote marks. Try this (note the use of this forum's CODE tag...):
Option Explicit
Dim path,
Dim objFSO
Dim objWshShell
Dim cmdln
Dim strCommonProgramFilesFolder
On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
If Not IsObject(objFSO) Then
WScript.Quit(False)
End If
Set objWshShell = CreateObject("WScript.Shell")
If Not IsObject(objWshShell) Then
WScript.Quit(False)
End If
strCommonProgramFilesFolder = objWshShell.ExpandEnvironmentStrings("%COMMONPROGRAMFILES%")
path = strCommonProgramFilesFolder & "\InstallShield\Driver\1050\Intel 32\IDriver.exe"
cmdln = path & " /M{AC568C0D-44AD-47B0-B21E-C303FE989C89} /uninst"
If InStr(cmdln, " ") > 0 Then
cmdln = Chr(34) & cmdln & Chr(34)
End If
WScript.Echo cmdln
If objFSO.FileExists(path) = True Then
objWshShell.Run(cmdln)
End If
Set objWshShell = Nothing
Set objFSO = Nothing
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.