Run Program using batch command?

Got a problem you cannot solve? Try here.
Post Reply
wxie
Posts: 8
Joined: Tue May 27, 2008 5:58 pm
Location: Canada

Run Program using batch command?

Post 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.
ulrichard
Posts: 150
Joined: Thu Dec 27, 2007 5:45 am
Location: Switzerland
Contact:

Is the CWD correct?

Post 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"
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post by jimo »

Try using Run Program As instead so you can set the working directory.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
wxie
Posts: 8
Joined: Tue May 27, 2008 5:58 pm
Location: Canada

Post 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.
Post Reply