samarth
samarth

Reputation: 4024

Trigger a Java program on startup of some windows service or program

I want my Java program or say some method within my class to be triggered when i start some Windows program(Application) .For example i want my program start executing(Trigger) when i start Realplayer.

Upvotes: 0

Views: 796

Answers (3)

fireshadow52
fireshadow52

Reputation: 6516

You can easily do this with DOS...

@echo off
start path\to\someApplication
start path\to\javaApplication

Enter the above code in notepad and save it as whateverNameYouWant.bat

When you run it, the batch file will launch the application you specified in the code AND the Java (.jar) application you specified in the code.

Upvotes: 0

mohdajami
mohdajami

Reputation: 9690

Here is a psuedo-code of what you have to do:

  1. Java application (Listener), registered as a Windows Service and runs on system stratup.
  2. Listener application keep listening until some .exe file is opened.
  3. Listener execute code (or call another application)

Upvotes: 1

Amanpreet
Amanpreet

Reputation: 526

I think you need to make a jar and then use some sort of Java Service Wrapper.... Still not sure.

What you actually require is to register a service in the Windows services.

Upvotes: 0

Related Questions