1

I recently encountered an error where XCOPY wouldn't work in a batch file returning:

'xcopy' is not recognized as an internal or external command, operable program, or batch file.

Several other commands (ie: HELP) returned the same error, which I discovered was due to where %SYSTEMROOT%\SYSTEM32 was defined in the path variable. It was burried in the middle, but moving it to the beginning fixed this issue.

I do not understand why other commands (ie: MKDIR in the same batch file) are still recognized when the other commands aren't. Are these defined elsewhere in the OS in a way that makes them always accessable?

Setup is Windows XP Professional 2002 SP3, 32-Bit running in Oracle VM VirtualBox.

Tony Gweesip
  • 194
  • 1
  • 9
  • 3
    xcopy is an actual executable (xcopy.exe) that resides in your system32 path. – ElGavilan Oct 28 '15 at 20:01
  • 1
    My system32 folder is buried in the middle as well and all my commands work just fine. Possible that you were editing the PATH variable incorrectly? – Squashman Oct 28 '15 at 20:05
  • @Squashman, I had never edited the path directly. I had installed other programs which had modified the path and added their directories at the beginning. It's possible that all I needed was a computer restart, but simply copying the SYSTEMROOT paths to the beginning of the PATH variable worked. – Tony Gweesip Oct 29 '15 at 15:59

1 Answers1

2

MKDIR and DIR are cmd.exe internal commands and are not separate executable files. Here you can find the fill list of the internal commands:

ASSOC, BREAK, CALL ,CD/CHDIR, CLS, COLOR, COPY, DATE, DEL, DIR, DPATH, ECHO, ENDLOCAL, ERASE, EXIT, FOR, FTYPE, GOTO, IF, KEYS, MD/MKDIR, MKLINK (vista and above), MOVE, PATH, PAUSE, POPD, PROMPT, PUSHD, REM, REN/RENAME, RD/RMDIR, SET, SETLOCAL, SHIFT, START, TIME, TITLE, TYPE, VER, VERIFY, VOL

npocmaka
  • 55,367
  • 18
  • 148
  • 187