Does anyone know of a way (say Powershell, or a tool) in Windows that can recurse over a directory and convert any unix files to windows files.
I'd be perfectly happy with a way in Powershell to at least detect a unix file.
It's easy do this for one single file, but I'm after something a bit more scalable (hence leaning towards a Powershellish solution).
You can use Visual Studio. File -> Advanced Save Options...
I spent 6 hours yesterday and today testing the code given above in a loop with 10,000 files, many of them >50kb in size. Bottom line, the powershell code is very inefficient/slow/unusable for large files and large number of files. It also does not preserve BOM bytes. I found unix2dos 7.2.3 to be the fastest and most practical solution. Hope this helps others and saves them time.
download vim, open your file and issue
Batch for multiple files (all *.txt files in C:\tmp - recursive):
There is dos2unix and unix2dos in Cygwin.
Opening a file with Unix line endings in Wordpad and saving it will rewrite all the line endings as DOS. A bit laborious for large numbers of files, but it works well enough for a few files every once in a while.
It works for me: