How to convert document from cmdline on windows

Nothing happens on this command. No file produced, no error message, errorlevel 0. What am I doing wrong?

L.

“C:\Program Files\LibreOffice\program\soffice.bin” --outdir “C:\Users\USER\Desktop_TEMP_” --convert
-to “html:XHTML Writer File:UTF8” “C:\Users\USER\Desktop_TEMP_\document.doc”

version 6.1.2.1

Error 1: --outdir is only valid after --convert-to.

Error 2: --convert-to does not have a space between --convert and -to.

So the proper command line would be

"C:\Program Files\LibreOffice\program\soffice.bin" --convert-to "html:XHTML Writer File:UTF8" --outdir "C:\Users\USER\Desktop__TEMP__" "C:\Users\USER\Desktop__TEMP__\document.doc"

A problem here is that on some Windows versions, the output from soffice isn’t sent to console (cmd). That is a known bug.

Thanks for reply. There is not space in ‘–convert-to’, probably linewrap in forum. Command you post do nothing too. All filepath verified twice.
You wrote SOME windows version does not output to console (STDOUT and/or STDER), do you known what version DO the output?

Just install LibreOffice 5.4.3 and exact same behaviour :-/

do you known what version DO the output?

Yes: Win10 with activated new-style cmd (the one where I test).

Command you post do nothing too

Nothing to say, except: I have created the directories, and tested it to work locally before posting. To have the output on any Windows, you might use cygwin.

Aha, I misunderstood sentence “some windows versions”. I understand it “some windows versions of libreoffice (oposit to linux versions)” and not “libreoffice under some windows versions”. Will test it under W10.

Same problem on Windows 10/64bit. Only difference compare to Windows 7 is, that “soffice.bin --help” output help screen there. Trying to google for details, bug report or anything else, but have no luck. Could you point me where people know more? I need single windows LO version which do console operations successfully. Or how to use cygwin in such case.

well, no idea where people could know more than a person who created the code (yours truly).

Only difference compare to Windows 7 is, that “soffice.bin --help” output help screen there

That was the idea (I mentioned that some versions don’t output error messages to console; you now see them, and I suppose that using the initial command would output useful messages wrt wrong argument order).

Now the question is if you get a correct HTML doing that interactively.

Interactive conversion working OK. You says it DOES working for you on windows 10, could you tell me EXACT version (both windows and LO) of your working combination?

Windows 10 Version 1809 (Build 17763.55)

LO Version: 6.1.3.2 (x64)
Build ID: 86daf60bf00efa86ad547e59e09d6bb77c699acb
CPU threads: 12; OS: Windows 10.0; UI render: GL;
Locale: ru-RU (ru_RU); Calc: CL

But actually it doesn’t matter, since it also works on the same system with, e.g., Version: 4.4.5.2
Build ID: a22f674fd25a3b6f45bdebf25400ed2adff0ff99
Locale: ru_RU

or with same LO version on Win7 VM

The question is either in your data (a sample would be useful), or LO configuration

LO configuration is default (just installed), original document is here http://www.praha.eu/public/3b/94/17/2775506_921045_shromazdeni.doc

Despite you’ve written

All filepath verified twice

I’ll still ask: Are you positive that you have the directory named Desktop__TEMP__ under your user’s profile directory, and not a __TEMP__ under Desktop?

EDIT: sorry for the noise (I removed the following incorrect comment): I really cannot reproduce with your data (it works on my system; my “reproducing” was because I used wrong paths left from my previous testing) - so: are you using correct paths?

Filepath and drivepath in my first post was broken for some reason, slashes missing.

By my local tests, I am using correct paths. Verified by:

'dir “C:\Users\USER\Desktop__TEMP__”

and

soffice.bin “C:\Users\USER\Desktop__TEMP__\document.doc”

both work ok.

could you please sent the full command line you actually use locally here, copy-pasted, and not re-typed; please include the command into the `` to preserve it verbatim. I need to see the file paths and names, just as they appear on your system.

C:>“C:\Program Files\LibreOffice 5\program\soffice.bin” --convert-to “html:XHTML Writer File:UTF8” -
-outdir “C:\Users\USER\Desktop_TEMP_” “C:\Users\USER\Desktop_TEMP_\shromazdeni.doc”

EDIT: This forum deleting slash between ‘Desktop’ and ‘TEMP’ for some reason, any time I paste. This is right paste: C:\>"C:\Program Files\LibreOffice 5\program\soffice.bin" --convert-to "html:XHTM - Pastebin.com

This forum deleting slash between ‘Desktop’ and ‘TEMP’ for some reason, any time I paste

Citing myself:

please include the command into the `` to preserve it verbatim

What you used (straight apostrophes ') wasn’t what I asked to use (`).

Unfortunately I cannot see anything wrong in your command line. It just works for me on any windows and any LO version. Of course, if I use something else in the command (like temporary profile), there’s a chance, but you don’t mention that…

I hope that my recent change would make debugging more straightforward.