My OS can not interpreter FOR command

  • Thread starter Thread starter ahmed ramadan
  • Start date Start date
A

ahmed ramadan

i have Windows 2000 Server,and when try to run the
following command :
FOR /F %%a IN ('CD') DO (
SET CMDDIR=%%a
)
The Error Message Display :-
..
'CD' is not recognized as an internal or external command,
operable program or batch file.
Note:
the above error not display on another servers except this
server .
 
ahmed ramadan wrote in
i have Windows 2000 Server,and when try to run the
following command :
FOR /F %%a IN ('CD') DO (
SET CMDDIR=%%a
)
The Error Message Display :-
.
'CD' is not recognized as an internal or external command,
operable program or batch file.
Note:
the above error not display on another servers except this
server .

I don't know what might cause that but I assume that you are running
CMD.EXE and that the "CD" command works outside of the batchfile.

For this (W2K) system perhaps a workaround is just to use the value in
the special variable %CD% for the time being.
 
Back
Top