Windows 7 Command prompt/.bat files issue

aubycek

New Member
Joined
Feb 20, 2016
Messages
2
Hello. When I create a simple .bat file (to run calculator for example), it will give me an error saying that "filename" is not recognized as an internal or external command. I am 100% sure this happens because there are some symbols before the command "calc". When I right click my .bat file and click on edit, there is just "calc" and nothing else. When I run it, the command prompt run it as "AiLcalc" or something similar to it, so it gives me an error. What to do with this? It happens with every .bat file I try to run.
-Windows 7 64bit, latest java downloaded
-Attached screenshot of how it looks like
 

Attachments

  • Untitled.webp
    Untitled.webp
    46.8 KB · Views: 396
Solution
aubycek,

Actually I found the issue.. somehow you're saving these documents in UTF-8 format..

I made a simple document containing "ECHO Testing!" in notepad, when saving it I used the following options (note the Encoding selected):
An image from 'Command prompt/.bat files issue'. Saving a batch file with 'ECHO Testing!' in Notepad leads to a command error when run in cmd.


When executing it I get the same issue you are stating:

An image from 'Command prompt/.bat files issue'. Saving a batch file with 'ECHO Testing!' in Notepad leads to a command error when run in cmd.


So the question is, are you intentionally saving in UTF8 format? Did you start with one document that may have already been UTF8 and appended to it? Simply saving it as a normal ANSI encoded document will fix it.
uhm this is very strange, almost points to memory issues perhaps...

Have you tried making your batch file in another text editor?
 

Tried now in Notepad++, same result. What do you mean by memory issues, could you be more specific please? And what could I do about it?
 

aubycek,

Actually I found the issue.. somehow you're saving these documents in UTF-8 format..

I made a simple document containing "ECHO Testing!" in notepad, when saving it I used the following options (note the Encoding selected):
An image from 'Command prompt/.bat files issue'. Saving a batch file with 'ECHO Testing!' in Notepad leads to a command error when run in cmd.


When executing it I get the same issue you are stating:

An image from 'Command prompt/.bat files issue'. Saving a batch file with 'ECHO Testing!' in Notepad leads to a command error when run in cmd.


So the question is, are you intentionally saving in UTF8 format? Did you start with one document that may have already been UTF8 and appended to it? Simply saving it as a normal ANSI encoded document will fix it.
 

Last edited by a moderator:
Solution
Back
Top