Closing A Program With BASIC/Batch
|
Original Message
|
Name: DaleSwanson
Date: August 20, 2005 at 03:32:21 Pacific
Subject: Closing A Program With BASIC/BatchOS: Win2kCPU/Ram: P4 |
Comment: I would like to know how I can close a program using either BASIC or a batch file. I know you can open with SHELL in BASIC, I'm basicly looking for the opposite of that.
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: wizard-fred
Date: August 20, 2005 at 05:27:49 Pacific
|
Reply: (edit)Unless a program is designed for it, there is no graceful way of closing it. BASIC and batch files are essentially single threaded. Once started it expects to come to an end at predefined points under control of the program. At best you can stop the program (Ctrl-Alt_Delete) but the point where the program is running is unknown.
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: uli_glueck
Date: August 21, 2005 at 22:24:10 Pacific
|
Reply: (edit)The NT - Ressource Kit has a Command line tool called kill.exe. It should work in Win2K also. (To list the processes use tlist.exe. Also in the ressource kit). uli
Report Offensive Follow Up For Removal
|
|
Response Number 4
|
Name: Shr0Om
Date: August 23, 2005 at 07:08:54 Pacific
|
Reply: (edit)You can kill a program with the command taskkill. Here is an example of how you kill notepad: taskkill /IM notepad.exe Just save this in a .bat or a .cmd file.
Report Offensive Follow Up For Removal
|
|
Response Number 6
|
Name: wizard-fred
Date: August 25, 2005 at 23:00:13 Pacific
|
Reply: (edit)Killing an application might be fine if it is not doing anything important. If the application is sending or receiving data, or is a database organizing data then there has to be a method of notifying the original caller of the program that the process was interupted. Note that you may lose data if you doing an inplace sort using ram for temporary storage.
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: