cognidox / OfficeToPDF

A command line tool to convert Microsoft Office documents to PDFs
https://www.cognidox.com/
Other
610 stars 137 forks source link

Hangs when started from service #19

Closed VanCoding closed 6 years ago

VanCoding commented 6 years ago

I want to use this tool to convert DOCX files to PDF files in my windows service, but when it runs as service the Word process hangs, uses CPU power, but never exits. If i start the process from the command line, everything works well.

I've also tryed using a different user for the service, or enabling desktop interaction, but that did not help.

I'm using Office 2016.

Is there something that I need to do first in order to make it work from services?

VanCoding commented 6 years ago

Ah, well, I've found the solution: Create the folder "C:\Windows\SysWOW64\config\systemprofile\Desktop" on x64 systems, or "C:\Windows\System32\config\systemprofile\Desktop" ond x86 systems, and the process will not hang anymore.

I found the solution here: https://social.msdn.microsoft.com/Forums/en-US/b81a3c4e-62db-488b-af06-44421818ef91/excel-2007-automation-on-top-of-a-windows-server-2008-x64?forum=innovateonoffice