KeyShot Forum

Technical discussions => Extending KeyShot => Scripting => Topic started by: Tiemo on August 07, 2019, 01:16:33 AM

Title: Run Keyshot in batch mode without Windows desktop?
Post by: Tiemo on August 07, 2019, 01:16:33 AM
Hi folk,

I would like to start keyshot from out of a Windows service to batch export data. Since a Windows service is running in insolation mode of session 0 without user interaction, the KeyShot process starts up but hangs with 120MB of RAM usage as long as KeyShot starting in session 0. If KeyShot is assigned to a logged on user, all is working well. I already tried a lot of all the windows APIs to prevent this behavior like CreateProcessAsUser, CreateProcessWithLogonW, etc.. But it is always failing as long as session 0 is used.

Is there any option to run KeyShot in batch mode that allows to run under session 0?

PS: To reproduce my issue simple start KeyShot using PSExec from Sysinternals: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
psexec.exe -s -i 0 keyshot.exe

Many thanks,
Tiemo
Title: Re: Run Keyshot in batch mode without Windows desktop?
Post by: jbeau on August 26, 2019, 11:25:53 PM
Out of curiosity, why not run KS from CLI?
Title: Re: Run Keyshot in batch mode without Windows desktop?
Post by: Tiemo on September 03, 2019, 06:20:35 AM
Hello jbeau,

thanks for replying.

Unfortunately, that's not possible since Keyshot should be controlled from a service. This service is communication with a PDM system that is holding the source data. So, it's a kind of ticked base communication. Each job is starting up KS using a source input file and a python script to generate the target files and sends back the results to PDM for managing the data later on on this site.

Even if I am starting a command shell from out of the service KS stops working right after it has been started for the mentioned reason.

Hope, this explains the process a bit more in detail.

Regards,
Tiemo