Microsoft Office 2007 and 2010 include a tool that can convert .doc-files to .docx-files from the command line.
This will not get rid of the compatibility-mode message -- that requires opening the file and saving it as a new format -- but it does help with reducing file sizes and cross-platform compatibilities.
The tool is called Wordconv.exe
and is located in the root Office folder,
e.g. Office14
.
The tool is unfortunately not documented anywhere,
but at least one basic usage is known:
"C:\Program Files\Microsoft Office\Office14\wordconv.exe" -oice -nme <input file> <output file>
Note that the tool creates a new, converted file with the specified name, and does not remove the old file.
With a basic for
-loop,
the tool can be used sequentially on all files in a directory:
for %f in (C:\docs\*.doc) do "C:\Programmer\Microsoft Office\Office14\Wordconv.exe" -oice -nme "%f" "%fx"
for /?
indicates that for
may sometimes not support recursive descent,
but if it does,
all files can be processed recursively with the /R
flag:
for /R %f in (C:\docs\*.doc) do "C:\Programmer\Microsoft Office\Office14\Wordconv.exe" -oice -nme "%f" "%fx"
To verify you're processing the correct files,
consider running a simple echo
first:
for /R %f in (C:\docs\*.doc) do echo "%f"
Note: the *.doc
pattern also matches any .docx files.
I suggest you to use this tool: https://freetools.site/document-converters/doc-to-docx