Interactive Windows Service

Install interactive Windows Service

Windows doesn’t allow apps to see JVMs started as Windows Service so one solution is to install a service using sc.exe – that will open a command prompt under local service account by executing this on cmd window.

C:\>sc create cmdservice binpath= "cmd /K start" type= own type= interact

Start cmdservice

C:\>sc start cmdservice

[SC] StartService FAILED 1053:

The service did not respond to the start or control request in a timely fashion.

Connect to the cmd shell

In the “Interactive Services Detection”, click on “View the message”

Monitor Java app started as Windows Service under local system account

1. Install a service using sc.exe – that will open a command prompt under local service account by executing this on cmd window

sc create debugservice binpath= "cmd /K start" type= own type= interact

2. sc start debugservice

(on a remote desktop session, this service has to be started only in console session for the command prompt window to pop up)
will print message that [SC] StartService FAILED 1053: but will start a command prompt under local system account.

3. Launch e.g. jconsole.exe