Writing Windows .bat files in Mac Can anyone suggest any decent software for writing .bat scripts in Mac that transfer over to Windows properly? I've tried using BBEdit and Sublime Text to write my .bat scripts but when I bring them over they don't work properly.

Sublime Text doesn't carry do newlines properly (even though it's set for Windows) so the scripts don't run.

BBEdit doesn't do certain things properly (like echo) even though I set the newline for Windows and the encoding to Western Latin 1.
I do use BBEdit successfully for my .bat files. As you say, you need to keep in mind that the newlines are set correctly. The concepts of line feed (LF) and carriage return (CR) are closely associated but used differently on Windows and *nix.

For the visitors, TextWrangler is the free (stripped down) version of BBEdit. Both are text editors for OS X, and they do not suck.

The screenshot below is the bottom of my .bat file created in BBEdit. I have build this file from scratch and it works just as you would expect. Make sure you have:


Text-encoding set to 'Unicode (UTF-8)'
Line breaks to 'Windows(CRLF)'




That should be enough.

If you keep having problems with these akward settings, copy a working .bat from windows to your mac and save it as a template for your new scripts. BBEdit will recognise the current settings in a .bat/text file.