Benjamin297
asked on
VB.NET Call executable with parameters in VB Script
I have the following code, plink is is an executable. I am running this code from the same directory as the executable. When I am testing the code it does not seem to be working. Any ideas why this might be, all of the variables are being assigned correctly. If I type the command directly into a command prompt it works. Any ideas why this isnt working, also is there a way to get the output that the executable is sending out and print it wo screen?
Set objShell = CreateObject("WScript.Shel l")
Set objExec = objShell.Exec("cmd /c plink '" & LoadBalancer & "' -l '" & Username & "' -pw '" & Password & "' bigpipe node '" & RebootComputer & "' down")
Set objShell = CreateObject("WScript.Shel
Set objExec = objShell.Exec("cmd /c plink '" & LoadBalancer & "' -l '" & Username & "' -pw '" & Password & "' bigpipe node '" & RebootComputer & "' down")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or try the vbscript function: Chr(34)
this makes " too
Try also:
objShell.Run not Exec
this makes " too
Try also:
objShell.Run not Exec
Then u can verify that's all right!
msgbox "cmd /c plink '" & LoadBalancer & "' -l '" & Username & "' -pw '" & Password & "' bigpipe node '" & RebootComputer & "' down")