relative path problem XP

O

Osiris

I have this .BAT file:
===========================
if "%1" == "sfx" (
cd xampp
)
if exist php\php.exe GOTO Normal
if not exist php\php.exe GOTO Abort

:Abort
echo Sorry ... cannot find php cli!
echo Must abort these process!
pause
GOTO END

:Normal
set PHP_BIN=php\php.exe
set CONFIG_PHP=install\install.php
%PHP_BIN% -n -d output_buffering=0 %CONFIG_PHP%
GOTO END

:END
pause
===================================
the BAT file is in C:\Program Files\xampp
the php.exe file is in C:\Program Files\xampp\php
When I click on the BAT file, the system cannot find the php.exe
program. but it is surely there.
I get the two echo's after :Abort.

What can be the cause of it ?
On another WinXPSP2 machine all is OK.
 
O

Osiris

new info:
when I add
DIR
at the beginning of the BAT script, I always get to see the DIR of C:\

So suddenly, BAT scripts execute "in" the root...
that is weird, considering the script IS in C:\program file\xampp.
 
O

Osiris

I think I found the cause:
there is a registry key AUTORUN that does it:

[HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
"CompletionChar"=dword:00000009
"DefaultColor"=dword:00000000
"EnableExtensions"=dword:00000001
"Autorun"="CD /D C:\\"

I got rid of it and now things seem to be normal.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top