Click here to Skip to main content
15,907,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i need to know status of the windows services. for example,i need to check it out Textpad.exe service is already running or not. any one can help to find the solutoin.

regards,

sasi
Posted
Comments
P.Salini 24-Sep-11 7:17am    
Do you want to check it from code

That is not possible in "clean" Java, but you can use ProcessBuilder[^] to run the command sc query Textpad and then read the output to determine the state of the service
 
Share this answer
 
here: http://www.rgagnon.com/javadetails/java-0610.html[^]

you can find a small example code to checking whether a certain program is currently executed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900