Search code examples
javawindowsapplication-shutdownsystem-shutdown

I want to check open applications before turn off my computer through java program


Actually I am working on a java based application which has a functionality to turn off my system on a specific time and it's working fine but, the requirement says that if any application is open then it should not be close before turn off my system must have to close all the open application manually. I am unable to find out the solution.


Solution

  • I have never tried this but it looks like you would have to use: Runtime.getRuntime().exec(). This seems to be a pretty good example of how to do this.