How to call doc2any.exe from ASP code?

Ok, That made a difference, but I need to run this from ASP so can I include the same parameters and how?

<%
    Set comEXEShell = Server.CreateObject("exeshell.shell")
    comEXEShell.RunCommandLine "Administrator", "password", "C:\doc2any_cmd\doc2any.exe C:\doc2any_cmd\example.doc C:\doc2any_cmd\new.pdf"
    Set comEXEShell = Nothing
%>
=======================================
Thanks for your message, please by following steps to call doc2any.exe inside a special user account,

1. Please download and install EXEShell COM Library (freeware) from following URL first,

https://www.verydoc.com/exeshell.html
https://www.verydoc.com/download/exeshell.zip

2. After you download it, please unzip it to a folder, register exeshell.dll by administrator privilege,

regsvr32.exe exeshell.dll

then you can call "exeshell.shell" from your ASP source code to convert DOC file to PDF file,

<%
    Set comEXEShell = Server.CreateObject("exeshell.shell")
    comEXEShell.RunCommandLine "Administrator", "password", "C:\doc2any_cmd\doc2any.exe C:\doc2any_cmd\example.doc C:\doc2any_cmd\new.pdf"
    Set comEXEShell = Nothing
%>

3. Because "exeshell.shell" COM component will switch user account from default SYSTEM user account to "Administrator" user account, in some windows systems, you may encounter #1314 permission problem, please refer to following solution for #1314 error,
===================================
Remark:
You may encounter Error 1314 in some Windows systems when you switch between user accounts, this is caused by permission setting, please by following steps to solve this 1314 Error,

ERROR 1314:
~~~~~~~~~~~~~
1314 A required privilege is not held by the client. ERROR_PRIVILEGE_NOT_HELD
~~~~~~~~~~~~~

To resolve this issue:
1. Click Start, click Run, type "secpol.msc", and then press ENTER.
2. Double-click "Local Policies".
3. Double-click "User Rights Assignment".
4. Double-click "Replace a process level token".
5. Click "Add", and then double-click the "Everyone" group
6. Click "OK".
7. You may have to logout or even reboot to have this change take effect.

Please refer to following two screenshots to understand above steps,

https://www.verydoc.com/images/err1314-1.png
https://www.verydoc.com/images/err1314-2.png

Please look at following page for the details about ERROR 1314,

https://www.verydoc.com/exeshell.html
===================================

"exeshell.shell" is a COM component for calling from ASP code, we have another solution to you, you can call cmdasuser.exe from ASP source code directly, cmdasuser.exe can also be used to switch the user account for EXE process.

Please refer to example #8 at following web page,

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

Example #8 (Run conversion inside an interactive user account from service or web applications),

Please by following solution to run doc2any.exe inside an interactive user account,

1. Please add "Everyone" user account to the folder of doc2any.exe, give "Full Control" permission to "Everyone" user account,

2. Download CmdAsUser.exe from following page,

https://www.verydoc.com/exeshell.html

You can also download it from following URL directly,

https://www.verydoc.com/download/cmdasuser.zip

3. Run following command line to test CmdAsUser.exe application,

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

If you can run above command line in Command Line Window correctly, please call above command line from PHP by shell_exec() function or other web applications, then you will get it work properly.

Please notice, you need modify "Administrator" and "password" parameters in above command line, CmdAsUser.exe will launch doc2any.exe from an interactive user account with administrator privilege.

If you encounter #1314 error, please refer to the solution for #1314 error at above.

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!