Bulk file conversion using command line

I have a large number of old MS Word documents that I would like to convert to odf using the in-built command line. I’m on a Windows 7 64 bit system and have LibreOffice 3.5 installed. From searching the web, it looks like the following command line command should convert all MS Word documents in E:\Docs\In to odf and place them in E:\Docs\Out.

>soffice.exe --headless --convert-to odf --outdir E:\Docs\Out E:\Docs\In\*.doc

However, the command line does nothing. If I specify a path to a specific document, e.g.

>soffice.exe --headless --convert-to odf --outdir E:\Docs\Out E:\Docs\In\a.doc

the document is converted to a.odf and placed into E:\Docs\Out. So, why doesn’t the first command work? Is it a bug, or is it just not intended for bulk conversion of all files in a directory?

Update:
I added a bug report for this issue, as it does not seem to be the intended behavior. https://www.libreoffice.org/bugzilla/show_bug.cgi?id=48413

It does bulk conversion in GNU/Linux.

It does indeed. I got it working using an Ubuntu live CD along with a USB stick with the files. It’s not recursive, though, so I ended up writing a .Net program to iterate through the file system and convert the files, maintaining the directory structure.

Have you looked at unoconv ? It’s a tool that communicates with LibreOffice for doing bulk conversions. It can iterate over files in a directory. It supports instructing the import and export filters on the command line so it is more flexible than using the LibreOffice command line.

Iterating over all files of a directory is probably a task for the shell. In case of Windows, that may mean a bat file or a powershell script, whichever sounds easier for you.

I do not mind making a script to do the conversion for me, but if LibreOffice can do it for me, I could use the time for something else. It seems that LibreOffice should be able to do bulk conversions http://help.libreoffice.org/Common/Starting_the_Software_With_Parameters

If you have cygwin try running:
find /path/to/in/ -regex .*.doc -exec soffice.exe --headless --convert-to odf --outdir E:\Docs\Out {} ;

If you have cygwin try running:

find /path/to/in/ -regex .\*.doc -exec soffice.exe --headless --convert-to odf --outdir E:\\Docs\\Out {} \;

Hi @mat8913 – Your other answer looks like a dupe of this one (modulo formatting). If that’s the case, please delete it when you get a chance. Thanks!

While waiting for the bugfix, you can use this: http://sourceforge.net/projects/bulkconvertulo/