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.

Customer
------------------------------------------------

image
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,

https://www.verydoc.com/blog/verydoc-release-notes-verydoc-releases-an-exe-com-of-verypdfcomruncmd-exe-today-verypdf-exe-com-does-allow-you-to-call-ms-office-and-any-exe-application-from-asp-php-c-net-etc-program-languag.html

https://www.verydoc.com/blog/how-to-call-doc2any-exe-from-php-source-code.html

https://www.verydoc.com/doc-to-any-shell.html

VeryDOC
------------------------------------------------
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.

Customer
------------------------------------------------
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,

https://www.verydoc.com/exeshell.html#CmdAsUser_Command_Line_Tool
https://www.verydoc.com/download/cmdasuser.zip

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

Where:
<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.

Notes:
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.

Examples:

CmdAsUser.exe Martyn . /p GingerNinja /c regedit
CmdAsUser.exe test . /p 123 /c "C:\Program Files\docPrintPro v4.5\doc2pdf.exe" -i htttp://www.verypdf.com -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,

https://www.verydoc.com/blog/running-doc2any-as-a-scheduled-task.html
https://www.verydoc.com/blog/how-to-call-doc2any-exe-from-asp-code.html

VeryDOC

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!