Windows CMD automatically appends some 'know extensions' to files when trying to run them. In this case it's changing your
truffle command to
truffle.js (instead of
...\node\bin\truffle.cmd) because a
Truffle.js file exists and
.js is a 'known extension'.
CMD's 'know extensions' are stored in the PATHEXT environment variable, which in my machine contains:
So, in my case, I just removed JS extension in the current console.
Or, I remove it system wide.
setx PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JSE;.WSF;.WSH;.MSC
setx does not update already opened consoles until you restart them.)