Replace Builtin commands with Custom Commands for CMD.exe
Solution 1:
Is there any way to replace cd
and dir
with other programs?
No, but you can come close - here's how:
-
You can create a batch file called
dir.cmd
.@echo off setlocal echo I have replaced dir endlocal
Example:
F:\test>dir.cmd I have replaced dir F:\test>
However you have to call it by its full name
dir.cmd
not justdir
, unless… -
You can use
doskey
to redefinedir
:doskey dir=dir.cmd
Example:
F:\test>dir I have replaced dir F:\test>