Windows – the.bat not recognized as an internal or external command, operable program or batch file

batch-filecommand linecommand-promptwindows

When I logon to this Windows 2008 R2 Server and launch a CMD window, the default directory is:

C:\Users\SVC_asl2trim>

So I added this to the PATH and then I issued:

C:\Users\SVC_asl2trim>set path
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
\WindowsPowerShell\v1.0\;D:\Program Files\Hewlett-Packard\HP TRIM\;C:\Users\SVC_
asl2trim\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

C:\Users\SVC_asl2trim>

I have a small .bat file in that directory above but I keep getting:

my.bat not recognized as an internal or external command, operable program or batch file

This is maddening. I do this so infrequently …. I know there is some trick I am forgetting.

Best Answer

My stupid mistake...

Credit should go to Dennis for verifying that my.bat should work but as he surmised, it was not named that. I thought I had renamed it correctly from my.txt to my.bat but the problem was that it was actually named my.bat.txt ! Fixing that was key to this problem.