简体   繁体   中英

Open new process from a java application which is started by a windows service

I'm having a java application which opens the notepad.exe using, Runtime.getRuntime().exec().

And I want to run this application as a windows service. So I created a windows service using C#.

and I could successfully installed the service using 'installutil' command.

But although my java application started properly by the windows service, it does not open the notepad.exe.

I thought the problem is where the service is run as a SYSTEM process but not as the current login user. So I installed the service under the current user, by giving user credentials in installutil command.

Then the service and the java application properly started under the current user and I could see notepad.exe also created under the same user. But notepad is not visible.

Can anyone guide what has happened here please.

Thanks

It sounds like it's being started in another context.

In service options try checking the "Local System account" radio button, and then checking the "Allow service to interact with desktop" checkbox.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM