Gostaria de alterar o comando dir
padrão no Prompt de Comando para outro programa.
Você não pode, pelo menos não diretamente, como dir
está incorporado em cmd.exe
:
Internal commands
The Windows CMD shell CMD.exe contains a number of 'internal' commands, additional 'external' commands are also supplied as separate executable files. External commands are generally stored in the C:\WINDOWS\System32 folder, this folder is part of the system PATH .
This arrangement means that both internal and external commands are always available no matter what your current directory happens to be.
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
No entanto ...
It is possible for a system to have an internal command and an external command with the same name. If you have a command called DATE.exe and want to run that in preference to the internal DATE command, use the full pathname to the file e.g. C:\utils\date.exe even if your current directory is C:\utils\
Fonte Comandos internos - Windows CMD - SS64.com
Então, em vez de usar apenas dir
, você precisa usar o nome completo do seu substituto, no seu caso:
c:\dir.exe