Not running %0 properly - exe bug

Convert your BATch files into EXEcutable format in one click.
Post Reply
NDog
Posts: 4
Joined: Fri Oct 06, 2006 11:26 pm

Post by NDog » Sat Dec 16, 2006 2:16 am

Running a compiled exe from folder c:\gamesx

source code is

Code: Select all

@ECHO ON&CLS

SET LOCALPATH=%0
SET LOCALPATH=%LOCALPATH:~1,-1%

%LOCALPATH%\..\script\%1.bat
PAUSE
EXIT
EXE Output is

C:\WINDOWS>SET LOCALPATH=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\bt6627.bat

C:\WINDOWS>SET LOCALPATH=:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\bt6627.ba

C:\WINDOWS>PAUSE
Press any key to continue . . .



Batch Output is (and so should EXE output be)

C:\gamesx>SET LOCALPATH="C:\gamesx\gamesx.bat"

C:\gamesx>SET LOCALPATH=C:\gamesx\gamesx.bat

C:\gamesx>C:\gamesx\gamesx.bat\..\script\.bat
'C:\gamesx\gamesx.bat\..\script\.bat' is not recognized as an internal or extern
al command,
operable program or batch file.

C:\gamesx>PAUSE
Press any key to continue . . .

Can you please stop running this as a temporary batch file or something because I need to run this using %0 so it needs to launch in the current directory

Thanks

Post Reply