Link to home
Start Free TrialLog in
Avatar of Benjamin297
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.Shell")
Set objExec = objShell.Exec("cmd /c plink '" & LoadBalancer & "' -l '" & Username & "' -pw '" & Password & "' bigpipe node '" & RebootComputer & "' down")
Avatar of merowinger
merowinger
Flag of Germany image

execute the script that u only see the command in a msgbox!
Then u can verify that's all right!

msgbox "cmd /c plink '" & LoadBalancer & "' -l '" & Username & "' -pw '" & Password & "' bigpipe node '" & RebootComputer & "' down")
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
or try the vbscript function: Chr(34)  
this makes " too

Try also:
objShell.Run not Exec