Failed to run doc2any.exe from a schedule job, the schedule job is being run "with highest privileges" on Server 2016

Using command line "doc2any.exe to convert DOCX files to PDFs" Conversion work properly when done with a user-interactive session. When this is run as a schedule job header information does not convert over to the PDF.


Thanks for your message, you can use "VeryPDFComRunCmd COM" to run doc2any.exe from an interactive user account, please look at following web pages for more information,

I don't see an answer to my problem in these pages.

Trying to run this conversion as a scheduled job where it simply converts all DOCX files in a folder to PDF, configured to run as a specific user account.

When script is run logged on as that user interactively the conversion works properly, when run as a scheduled job, as the same user, but not logged on interactively, the conversion runs successfully, but the MSWord doc header does not show up in the PDF and the formatting is messed up. Almost like it was converting to a RTF and then to a PDF.

The schedule job is being run "with highest privileges". OS - Server 2016.

Example attached.

Yes, I understand this problem, because MS Word can't be run inside the system user account, you have to run it inside an interactive user account in order to convert from Word documents to PDF files properly.

You can use "VeryPDFComRunCmd COM" to run doc2any.exe from an interactive user account, however, if you wish to use a Command Line EXE instead of DCOM, you may use CmdAsUser.exe to do this work, CmdAsUser.exe is a command line application, you may download CmdAsUser.exe from this web page to try,

Usage: CmdAsUser.exe <user> <domain> [/p <password>] [/c <command>]

<user> is the name of the user.
<domain> is the logon domain, specify a period '.' for local.
<password> (optional) is the users password.
<command> (optional) is the command line to execute as the specified user.

If the password is not given then you will be prompted for it.
If the command is not given then "cmd" is assumed.
The calling process needs to either have administrative privileges (i.e. in the local adminstrators group) or at LEAST the following privileges:
"Act as part of the operating system" (SeTcbPrivilege),
"Bypass traverse checking" (SeChangeNotifyPrivilege),
"Increase quotas" (SeIncreaseQuotaPrivilege),
"Replace a process level token" (SeAssignPrimaryTokenPrivilege).
The utility may take a while if there is inappropriate security so please be patient.


CmdAsUser.exe Martyn . /p GingerNinja /c regedit
CmdAsUser.exe test . /p 123 /c "C:\Program Files\docPrintPro v4.5\doc2pdf.exe" -i htttp:// -o "C:\out.pdf"

for example, you can run following command line to run doc2any.exe from "Administrator" user account,

C:\doc2any\CmdAsUser.exe Administrator . /p password C:\doc2any\doc2any.exe C:\test.doc C:\out.pdf

Please look at following web pages for more information,


VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Code   If you cannot see the CheckCode image,please refresh the page again!