Link to home
Start Free TrialLog in
Avatar of engg
engg

asked on

running .exe in windows scripting host

Hi,

I have this code to run .exe using Windows scripting host. I am getting this error "The system cant find the file specified."
Is the code right?  I am new to WSH.  I have run the same exe before and the path is correct. arg1 is the argument that needs to be passed to test.exe.   Please help. Thank you.

Dim shell
Dim quote
Dim pgm
Dim arg
set shell = WScript.CreateObject("WScript.Shell")
quote = Chr(34)
pgm = "C:\test\bin\Debug\test.exe"
arg = "arg1"
shell.Run quote & pgm & " " & arg


ASKER CERTIFIED SOLUTION
Avatar of EDDYKT
EDDYKT
Flag of Canada 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
Avatar of engg
engg

ASKER

Thanks EDDYKT for ur prompt reply.  It worked. Sorry for taking time to get back to u!