Wednesday, April 17, 2013

Visual Studio 2010 Save a text file as a bat or cmd file without errors



Repost from...http://stackoverflow.com/questions/854360/visual-studio-inserts-invalid-characters-in-batch-files

Error Message:

C:\>
'' is not recognized as an internal or external command,
operable program or batch file.
Creating tables on server (LOCAL) and database PLEDGES
Done creating tables.


Quick Solution

In VS2008 and VS2010, select your file in the solution explorer and choose File...Save myfile.bat As...
On the down arrow on the Save button, choose Save with Encoding.
When saving in the Advanced Save Options dialog, Choose US-ASCII in the Encoding drop-down list. Set the line endings as required, or leave it as Current Setting.

No comments: