/build/static/layout/Breadcrumb_cap_w.png

Multiple Cmd line args using vbscript

:::: trying to run this script: Anything wrong in it?? Its not giving any error though.
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)

Posted by: anonymous_9363 12 years ago
Red Belt
0
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.
 
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