This question already has an answer here:

There is a directory tree on a Windows7 machine containing a few hundred text files that I want to convert from LF to CRLF.

I already found a Win32 version of UNIX2DOS but that one accepts only one file at a time for input whereas I want to convert a whole set of directories and subdirectories recursively in a single run.

What is the easiest way to accomplish that task?

marked as duplicate by phuclv, bertieb, Toto, Pimp Juice IT, PeterH Oct 29 '18 at 16:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


for one directory, open a command-prompt window, cd to the desired folder and

for %f in (*.txt) do UNIX2DOS %f ...

or for all subdirectories use the /R option

for /R %f in (*.txt) do UNIX2DOS %f ...

It may be worth remembering that, unlike notepad, editors like wordpad and notepad++ are happy with LF as line endings.

If you are converting a bunch of text files, you might also consider converting to UTF-8 using something like recode or iconv.

Not the answer you're looking for? Browse other questions tagged or ask your own question.