How to show windows background process in the foreground

Viewed 693

My problem description:

I have a server with OS version Windows 2012R2, I have two process running on it. this is one of them

I have a .bat file to start them. Below is the detail of .bat file:

e:
cd E:\autostart
echo =========================     1.RUN PCG    =========================
start startWebworksServer_PCG
echo =========================     2.RUN PHONE     =========================
start startWebworksServer_PHONE

Now I create a .jar file and make the jar as a windows service. just like this : enter image description here

This service will start these 2 processes in the background, I cannot see the windows of these 2 processes.

I want to find a way to have this service start these 2 processes in the foreground, so that I can see these 2 windows after logging in to the server. It is best to use java language.

PS:I tried to use JNA because I was first exposed to JNA and I failed. I tried to use Advapi32.INSTANCE.CreateProcessWithLogonW but it still started the process in the background and I still can't see the process window.

1 Answers

Services usually does not show any window, but as far as I remember, you should have a checkbox "allow this service to interact with the desktop" in the service properties. This of course would work only if there is a user session.

Related