When I execute a command with the same name as an internal command, instead of searching in the path Windows simply uses the one found in CMD.EXE.
For example, MKDIR is an internal command built into
CMD.EXE. It does not support the same options as the Unix version (e.g.
--help). If I use these options Windows will simply create files named -p or --help even though I have the GNU version of mkdir installed in a directory in my path.
This becomes an issue when working with certain programs that use mkdir through the terminal. For example, the gulpfile for prose contains three
mkdir -p commands that, create a folder
-p in the working directory and then throw errors. I have to manually edit the gulpfile such that it uses the installed mkdir.exe, which makes it harder for me to share my fork cross-platform.
How can I force the Windows shell to use the
mkdir.exe found in PATH rather than CMD.EXE?