Computing.Net > Forums > Programming > Closing A Program With BASIC/Batch

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Closing A Program With BASIC/Batch

Reply to Message Icon

Name: DaleSwanson
Date: August 20, 2005 at 03:32:21 Pacific
OS: Win2k
CPU/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.



Sponsored Link
Ads by Google

Response Number 1
Name: wizard-fred
Date: August 20, 2005 at 05:27:49 Pacific
Reply:

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.


0

Response Number 2
Name: DaleSwanson
Date: August 20, 2005 at 09:14:31 Pacific
Reply:

Hmmm, maybe I wasn't quite clear. I want to stop another program not the QBASIC/batch one.


0

Response Number 3
Name: uli_glueck
Date: August 21, 2005 at 22:24:10 Pacific
Reply:

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


0

Response Number 4
Name: Shr0Om
Date: August 23, 2005 at 07:08:54 Pacific
Reply:

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.


0

Response Number 5
Name: Shr0Om
Date: August 23, 2005 at 07:09:38 Pacific
Reply:

Ahh, taskkill is used in WinXp.. Dunno if it works in w2k.


0

Related Posts

See More



Response Number 6
Name: wizard-fred
Date: August 25, 2005 at 23:00:13 Pacific
Reply:

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.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Closing A Program With BASIC/Batch

Help closing a program with c++ www.computing.net/answers/programming/help-closing-a-program-with-c/12777.html

CALL a program with a Batch file www.computing.net/answers/programming/call-a-program-with-a-batch-file/13968.html

Modifying a program with a program www.computing.net/answers/programming/modifying-a-program-with-a-program/7203.html