Discussion Locked

Good old DOS batch file question

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Does anyone know how to stop an application from inside a DOS Batch file. I'm starting a Java app with the scheduler and I want to end it after a certain time period.

Thanks!

4 replies

by andrew

I don't know if it's possible to locate and terminate a process solely from within a batch file. You could write a small app to do this, one that gets kicked off from a batch file.

Your batch file could set an environment variable or write a filethat your app polls for, and shuts down when detected.

Why not have your app shut itself down after a certain time period?

by peter ritchie

In the Microsoft Resource Kit there's a command line utility called KILL. That utility can be called from within a batch file to kill a process based on its process id or process name.

KILL can also be passed to the scheduler so it can also be scheduled to kill your process after a certain time.

This discussion is closed to new replies.