Page 1 of 1

Batch file problem in Win7

Posted: 08 Sep 2014 10:51
by val5662
Hi all....
Using Windows 7 pro.
I have a bat file in a different folder than the trackman.exe I want to start.
Bat file is:

Code: Select all

@echo off
start "" "C:\Sierra\Viper Racing\Data\trackman.exe"
exit /b

When I activate the bat file,I get 2 errors from the program itself ( in german),
and it does not start.
If I put the same bat in the same folder as "trackman.exe" and activate it there , it will start it instantly.
In both cases it will start it,and simultaniously a cmd box appears and dissapears in a millisecond
(that part is ok).
What am I doing wrong
Help please!Thanx!
Val

Re: Batch file problem in Win7

Posted: 08 Sep 2014 12:03
by Squashman
I assume that Trackman.exe is expecting the working directory to be where the executable resides. The working directory will essentially be the directory where the batch file resides. So if the batch file resides in a different folder I would put a PUSHD statement in.

Code: Select all

@echo off
pushd "C:\Sierra\Viper Racing\Data"
start "" "C:\Sierra\Viper Racing\Data\trackman.exe"
exit /b

Re: Batch file problem in Win7

Posted: 08 Sep 2014 13:03
by val5662
:D Thanks a bunch Squashman!
It worked 100%.
I never heard of the "pushd" thingy before.
Thanks again!
Val

Re: Batch file problem in Win7

Posted: 08 Sep 2014 15:44
by Compo
perhaps this would do the same…

Code: Select all

@PushD C:\Sierra\Viper Racing\Data
@Start trackman

Re: Batch file problem in Win7

Posted: 08 Sep 2014 16:14
by Squashman
Compo wrote:perhaps this would do the same…

Code: Select all

@PushD C:\Sierra\Viper Racing\Data
@Start trackman

Yep

Re: Batch file problem in Win7

Posted: 08 Sep 2014 16:36
by foxidrive
This is another way it should work:

Code: Select all

@start "" /D "C:\Sierra\Viper Racing\Data" "trackman.exe"

Re: Batch file problem in Win7

Posted: 08 Sep 2014 19:50
by val5662
:D Compo and foxidrive....
Thanks to you guys also.Those codes worked great too!
Va.