Writing Windows .bat files in Mac
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.