I have a Java application installed as Windows Service using Apache Common Daemon (windows server 2008).
I need to run excel.exe command within my application, so I set up my service in order to be capable of interacting with desktop (by checking the box in Logon tab on service's properties).
In this way, when I call start() method of ProcessBuilder the popups shown here appear to me.
Is there a way to avoid this?
My intention is to run my java app as service and run multiple instances of excel.exe in parallel in order to process several .xlsm files simultaneously, but I do not want to interact in any way.
I have already read this article about Session 0 Isolation, so I'm wondering if it is really possible to start many excel.exe (or any other "GUI command") from a Windows service on WinServer 2008?
Thank you.
This is the solution I've found until now (seems working at the moment)
Following zapl's suggestion I've made a .vbs in order to exec my macro directly using the script.
Then I've modified the user running excel to match with the one used to start the service (thanks to this)
After this I've changed my ProcessBuilder from this:
ProcessBuilder pb = new ProcessBuilder("cscript.exe", excelPathArg....)
to this:
ProcessBuilder pb = new ProcessBuilder("cmd", "/C", "cscript.exe", excelPathArg....
Now, even if the user used to start the service is logged off ProcessBuilder seems to be triggered correctly.
I'll provide more details as soon as I'll dig more into it