LibreOffice has a command-line feature that would allow you to specify wild-card (*.doc) files on the command-line, and write their *.docx counterparts into the current working directory, or a designated directory location. This all runs headless in the Terminal, so LibreOffice itself is never seen on the screen.
Here is the Bash function that I have declared in my ~/.bashrc file that gets loaded via ~/.bash_profile each time I launch Terminal.
Bash function (Scrollable)
to_docx () {
for file in "$@" ;
do
if [ -s $file ]; then
/Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to docx:"MS Word 2007 XML" "${file}"
else
printf "\n%s\n\n" ">>> $file not found or zero length."
continue
fi
done
}
There is another option to soffice which is --outdir (e.g. --outdir ~/Desktop) which should be the last entry before the input file (which also can be (~) relative addressing). So, whether you want a Bash shell function, or transplant the code into a Bash script or a drag & drop Automator application (Run Shell Script) — this should help you automate the conversion of .doc to .docx.
In my .bash_profile:
[[ -s ~/.bashrc ]] && source ~/.bashrc