Search code examples
xmlwindowsdos2unix

Remove BOM from XML files for the subdirs using dos2unix in Windows


I have some problems with BOM symbols in a large amount of XML files nested in the subdirectories. Some of them have the BOM and I need to remove it. I can do it for the exact directory like this:

dos2unix.exe -r d:\path\to\directory

But I need something like a BAT file to remove BOM for the files in the subdirectories to save the time. How can I do this?


Solution

  • Sounds like you don't need a batch file, but just for /R %X in (*.xml) do dos2unix -r %X