Skip to main content
GameDev.net gamedev.net
🔒 Locked

Killing Windows apps

Started by Zibar Jun 3, 2003 at 4:40 PM 5 replies 750+ views
Original Post
Zibar
Zibar
Long time ago when I still used UNIXes I remember that I have used the command ps -kill quite often. Now WinNT has this nice task manager, that becomes a disaster if a fullscreen application stops responding, especially if this application is in exclusive mode. I often need to press the little reset key. While Task Manager works perfectly for the most normal applications it is not good for killing fullscreen applications and when I make such programs (and I have lots of bugs) I am often quite frustrated. What do you do about that? Is there a way to kill fullscreen applications in WinNT gracefully? I think Windows need the console funtionality found on Linux (where one can kill and restart x if necessary)
Mastaba
Mastaba
taskkill is available. You can use it to kill any process by name or id. The trick is in creating a script that you can run with a hotkey combo.
Zibar
Zibar
thanks, sounds interesting
are there any examples how to do it?
Mastaba
Mastaba
As an example, assume you wanted a way to close foo.exe
Then create a file called killfoo.bat, and in that file place:

taskkill /im foo.exe

Now create a shortcut to killfoo.bat on your desktop.
Do a right click on the shortcut, and select properties.
Click in the Shortcut key edit field, and then just push some letter or number. Ctrl-Alt-Key will be the keycombo that will activate the shortcut.
Now when foo.exe is running, you can just press Ctrl-Alt-Key and foo.exe will close. Or rather, should close. If it fails to close, you can try adding the force option, /F , before the /im.
Mastaba
Mastaba
Also I just tried this method with Quake II running fullscreen. It worked, though Quake2 reported a message about SwapBuffer failing. It did successfully terminate, and even returned the display to the normal desktop mode.
Zibar
Zibar
Thanks if it works for me it will be great... now I first have to find taskkill of course ;_)
Zibar
Zibar
found it

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.