Every time I create .cmd file and execute it windows finds strange symbols at start of file: ie:

REM ping
ping localhost

leads to

C:\>я╗┐REM ping
'я╗┐' is not recognized as an internal or external command,
operable program or batch file.
...

I've checked encoding of .cmd file and it seems to be fine. Even HEX editor didn't show any strange in file.

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

It looks like a BOM, a Byte Order Mark, although I do not recognize for which encoding. Make sure you save the file with ASCII or ANSI encoding.

If it's not a BOM (because it should normally show up in a hex editor), maybe it's a problem with the Command Prompt. Have you tried using .bat instead of .cmd ?

link|improve this answer
Great! Changing text encoging from UTF-8 to windows-1250 solves the issue! Thank you Snark! – Meta Feb 27 '10 at 13:05
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.