Page 1 of 1

Run Program using batch command?

Posted: Fri May 30, 2008 1:59 am
by wxie
Can I use Run Program command to execute a batch command? I have a Run Program command after Apply Install with the purpose to install and start a Windows service, it doesn't seem to work. [The service and the batch file are installed properly. And manually run the batch works just fine.]

My code looks like:
Run Program $TARGETDIR$\\myServiceFolder\\Install_Start_Service.bat (Wait)

Thanks,

William X.

Is the CWD correct?

Posted: Fri May 30, 2008 2:36 am
by ulrichard
Just a thought as I heard and found out that the current working directory doesn't seem to always be correct with the run program command. Sometimes people have to call a kernel32 function before executing to set the cwd. But as you run a batch, maybe it's enough to insert some lines like that at the front of the batch :

C:
cd "C:\\Program files\\myProg"

Posted: Fri May 30, 2008 7:53 am
by jimo
Try using Run Program As instead so you can set the working directory.

Posted: Fri May 30, 2008 1:36 pm
by wxie
Thanks, Jim.

The Run Program As command works.

Still not sure why the Run Program command doesn't do the job ;-)

William X.