The Windows environment has apparently been set up differently on Windows 2000 than on Windows 2003 R2 64-bit Edition, such that command line parsing follows different rules when the Windows command shell interprets bat file statements.
To illustrate this problem, try this sample bat file (copy and paste it into your own bat file, on various different PCs). Call it whatever name you want. For the purposes of this illustration, I am calling it xyz.bat, but you can call it anything.
ECHO ON
ECHO !!!! in Tldrbat.bat !!!
ECHO !!! CMDEXTVERSION IS %CMDEXTVERSION% !!!!
if /i "%1" EQU "FSIRC" (
echo IN 1a
set Op1=
set FSIRCOp="FSIRC=
)
pause waiting - got past first test OK.
Now, once you have copied/pasted/saved this bat file, try running it as follows.
First cd to the folder that contains your bat file, and enter the following command exactly as follows
xyz "a=b"
If you run it on Windows 2000, here is what you will see, indicating that the processing made it throught the "if /i" statement OK:
C:\TEMP>pause waiting - got past first test OK.
Press any key to continue . . .
at which point just hit Enter and the bat file will terminate.
But if you do the same thing on Windows 2003, here is the console response:
=b"" was unexpected at this time.
and control immediately exits the bat file, never getting to execute the pause statement.
Is there anyway to have Windows 2003 parse in the same manner as in Windows 2000? Is there anyway around this problem? Thank you.
To illustrate this problem, try this sample bat file (copy and paste it into your own bat file, on various different PCs). Call it whatever name you want. For the purposes of this illustration, I am calling it xyz.bat, but you can call it anything.
ECHO ON
ECHO !!!! in Tldrbat.bat !!!
ECHO !!! CMDEXTVERSION IS %CMDEXTVERSION% !!!!
if /i "%1" EQU "FSIRC" (
echo IN 1a
set Op1=
set FSIRCOp="FSIRC=
)
pause waiting - got past first test OK.
Now, once you have copied/pasted/saved this bat file, try running it as follows.
First cd to the folder that contains your bat file, and enter the following command exactly as follows
xyz "a=b"
If you run it on Windows 2000, here is what you will see, indicating that the processing made it throught the "if /i" statement OK:
C:\TEMP>pause waiting - got past first test OK.
Press any key to continue . . .
at which point just hit Enter and the bat file will terminate.
But if you do the same thing on Windows 2003, here is the console response:
=b"" was unexpected at this time.
and control immediately exits the bat file, never getting to execute the pause statement.
Is there anyway to have Windows 2003 parse in the same manner as in Windows 2000? Is there anyway around this problem? Thank you.