When executing certain files (mainly batch) using PsExec I get these weird ́╗┐' symbols before my command. My initial thought was, that I were using wrong encoding, but after checking, I realized that all my files were using UTF-8.
This has two causes:
Configure your editor to stop adding the BOM to UTF-8–encoded files. (It only makes sense in UTF-16, and is very useless in UTF-8.)
Those are Unicode Byte Order Marks. Cmd.exe doesn't understand them. If you resave your files in Notepad with ANSI encoding, that should fix the problem.
For example, I created this batch file:
First I save it with UTF-8 encoding
Then with Unicode
And finally with ANSI
To further @dsolimano's answer, if you are specifically using Visual Studio, and in my case it's 2013, I fixed it by doing the following:
Now, when you open a .bat file from within Visual Studio, you will initially get prompted with:
You will want to drill down through the options until you come to the DOS option of your language:
Click OK to finish opening the file.
Ok, even though it should be fairly obvious at this point, if you can see the
With all of that in place, you will be glad to know that you may now view, edit, and save your .bat file(s) from within Visual Studio so that cmd.exe no longer gives you the aforementioned heinous error of: