How to close running program?

Is there a way to close a program in Windows if I know the loaded exe name? How is this done?There is a program called kill.exe from the NT resource kit. It's used as "kill.exe processname". I'd like to use something similar but through a Java object.Thanks,Brett
[293 byte] By [brettr15] at [2007-9-30 16:55:37]
# 1

Go to the task bar at the bottom and right click on an empty space on it. You should see a popup menu with 'Task Manager...' on it. Click it and up comes the task manager. Choose it's 'Processes' tab and look for the running executable you wish to stop; select it and right click for it's popup menu. Click 'End Process'

Martin3 at 2007-7-6 13:09:04 > top of Java-index,Administration Tools,Sun Connection...
# 2
I thought it was implied but I meant programmatically.
brettr15 at 2007-7-6 13:09:05 > top of Java-index,Administration Tools,Sun Connection...
# 3
if the process is started by your program then processObject.destroy should do that
kamalindia at 2007-7-6 13:09:05 > top of Java-index,Administration Tools,Sun Connection...
# 4

You can close only those programs which you run through your java program. e.g. you can run a batch file through your java program as follows:

Runtime runtime = Runtime.getRuntime();

Process process = runtime.exec("c:\\my.bat");

Now you have a reference of your created program. At any time you can close it as follows:

process.destroy();

amersohail794 at 2007-7-6 13:09:05 > top of Java-index,Administration Tools,Sun Connection...
# 5

This will be done on a Win2003 Server. A ColdFusion template will call the Java object to run the program. What exactly do I need to install on the Win2003 server for this small Java object to work?

Once a CF template initially loads the object, should any other CF template should have access to the loaded object?

Thanks,

Brett

brettr15 at 2007-7-6 13:09:05 > top of Java-index,Administration Tools,Sun Connection...
# 6
u can kill (or close)a program by using Runtime.Here is codes.e.g.to close running notepad application...type thisRuntime.getRuntime().exec("taskkill notepad.exe");
skid_myanmar at 2007-7-6 13:09:05 > top of Java-index,Administration Tools,Sun Connection...
# 7
I've fogotten some arguments...Here is the complete.Runtime.getRuntime().exec("taskkill -im notepad.exe");
skid_myanmar at 2007-7-6 13:09:05 > top of Java-index,Administration Tools,Sun Connection...
# 8
you can? I thought that java stopped anything bad from happening...(kill "explorer.exe"...)
Zebediah at 2007-7-6 13:09:05 > top of Java-index,Administration Tools,Sun Connection...
# 9
I tried the exact, cut and paste copy of that in an application... it sends the IOException every time. why?
Zebediah at 2007-7-6 13:09:05 > top of Java-index,Administration Tools,Sun Connection...
# 10
there is no such thing as taskkill.......Using the process object to kill it is one way of doing it.
bjon045 at 2007-7-6 13:09:05 > top of Java-index,Administration Tools,Sun Connection...
# 11
If you are under Windows system and able to get the handle of the program's window, maybe execute the "RunDll32.exe" to send a terminated message would do. En... it's also difficult, too. Just take it a direction.
kusk at 2007-7-6 13:09:05 > top of Java-index,Administration Tools,Sun Connection...