The only computer game that I play is Counter-Strike Source, commonly shortened to CS:S or simply CSS. My desktop computer is powerful enough to handle the game but once in a while when I am playing the game half way, the game would just hang, sound is looping and nothing happens when I move the mouse or type anything on the keyboard. Weirdly, only the Counter Strike game hangs but my computer is still working fine. I know that my computer didn’t hang because when I press either the Num Lock, Caps Lock, or Scroll Lock keys at my keyboard, the LED light for the following keys would turn on and off.
I’ve tried pressing Alt+Tab to switch between Windows, Alt+F4 to close the active program, Ctrl+Shift+Esc to launch Windows Task Manager, Ctrl+Alt+Del to launch Windows Security dialog box, but NOTHING worked! The only way is to hard reboot the computer by pressing the reset button at the computer case. Hard resetting a computer is never good because it can damage the hard drive and cause data corruption.
Now I’ve figured a way to automatically terminate the game by pressing a shortcut key when it hangs.
Actually it is pretty simple and doesn’t require any advance level of computer knowledge. First you need to know what is the process name used by the game. Let’s take Counter Strike Source as an example. You can check the process name for the game by right clicking the CSS shortcut and select Properties. Go to the Shortcut tab to view the Target. As you can see, CSS process is actually hl2.exe (half-life 2).

Now you need to create a batch file that will kill the hl2.exe process when you simultaneously hit a combination of shortcut keys. Open Notepad (Start > Programs > Accessories > Notepad), and type the command line shown below.
taskkill /IM hl2.exe
You should replace the hl2.exe with the target of your game that you want to kill. Save the text file as killcss.bat or whatever you want to call it as long as the extension is .bat and not .txt. When you run the killcss.bat file, it should be able to close the game. Now we will assign a shortcut key to run the batch file.
Right click the killcss.bat file and select “Create Shortcut”. A new file named “Shortcut to killcss.bat” will appear. Right click at “Shortcut to killcss.bat” file and select Properties. Click at the Shortcut Key blank area and type any key of your choice. If you type the letter “L”, it will automatically assign Ctrl + Alt + L as the shortcut key to run the killcss.bat file.

One very more important rule is that the .bat file MUST be placed at desktop for the shortcut key to take effect.
When the game hangs in future, I just need to hit Ctrl + Alt + L key to kill the game so I can restart the game without hard resetting my computer.
Thanks! Very useful!
I hate when games hang. When they do, most of the time my mouse has disappeared.
Bought new Acer PC 2 days ago, format & clean install Win 7 64 bit and already I had my first game hang (Fallout New Vegas). ALT+CTRL+DEL and tab it to task manager won’t kill the damn game but logoff and re login could.
Too bad doing that kills off my utorrent which was running at great speed at the time :(…
how’s it different then running task manger and selecting processes tab and do ‘end process from there’
in this case it’s not needed to create a shortcut for every program that hangs the PC.
just add taskmgr to your start menu and it will start up on login….
Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.
I have a question, i have vista and when i click on properties i get a whole lot of sidetabs besides the one you show on xp.
“C:\Program Files\Steam\Steam.exe” -applaunch 240 that’s what i see instead of hl2.exe, can you help me please cause it’s really annoying
Hi.
Could it be, that taskkill doesn’t work always? I am using a buggy beta that is not developed anymore. It hangs seldom but it does some time. I always had to reboot since the button to stop a process in taskmanager doesn’t work if the process hangs (someone wonders why they built a completely useless feature? wait.. its ms…) Anyhow, I thought I can use taskkill to FORCE a process being stopped like I know from Linux where KILL -9 really kills a process forcefully, no matter if it’s responding or not.
However, taskkill does nothing but telling me that the process has been killed but in the tasklist the programm is still running. Then I tried to kill with /pid, again taskkill tells me the process has been killed but nothing happens. I can fire taskkill /pid /f as often as I want with the same of the hanging process, always I get the message, that it has been killed but it’s still there.
Where is the REAL force option?
Awesome find Raymond.
I have posted the article in my blog alongwith a backlink to ur site.
Thanks Raymond.. Its a great help for me..
Ah…..a life saver!
i had the same halflife2 hang problem as you, “taskkill /IM hl2.exe” may work but i suggest “taskkill /F /IM hl2.exe”
it’s lucky that halflife2 does not block hotkeys but some games do, ctrl+alt+del is unblockable and i write a small program to make use of it
source: linuxfire.com.cn/~moo/files/code/CtrlAltDelAction.zip
prebuilt binary: linuxfire.com.cn/~moo/code/CtrlAltDelAction.zip
install:
CtrlAltDelAction.exe taskkill /F /IM hl2.exe
remove:
CtrlAltDelAction.exe
usage: hit ctrl+alt+del after install and “taskkill /F /IM hl2.exe” will be executed right before taskmgr.exe is executed
more notes: linuxfire.com.cn/~moo/log/left/ctrl-alt-del-action
(the precompiled file need msvcp80.dll msvcr80.dll)
Thanks, I couldn’t get the shortcut key to work whilst the game (Guild Wars) was maximised however the program Mojo linked works brilliantly (so far).
does this command work at every type of windows such as vista
thanks for the tip …. i hate it when my computer do so and hope this will real help
thank you so much Jayhan, i had the same problem but now is ok.
Thanx ray………This tip was really nice……..:)
nice tips man… i really love it. :-)
Ok my bad, It seams like everythig has to be on the desktop- batch file + shrtcut for the key call to be efective. Now it works. This tip made my day. Thks Ray.
i guess i was wrong, I need a functional shortcut key. If The comp hangs, usualy it freezes the desktop and you can not acces anything on it. So a fix for vista would come in handy.
thks
I have a prbl with Avira free. Sometimes(many times) at startup, my computer hangs and avira stays on desktop for ever.(I disabeled the pop-up screen for updates from avnotify) So far only reseting the hard was usefull. I tried your tip , and I created a batch file on my vista home premium. I asigned a key, but it doesen,t work. However it works with 2 click on shortcut. Any ideas? I could use what I get so far I guess anyways.
Great tip
Okay, I just found out that Windows XP Home users are unable to run this command because it’s meant for XP pro users only. For all you home users, you can try using tskill instead. So instead of keying in the command Raymond mentioned in the bat file, key in :tskill [process] . dont use the brackets, also you need not key in the .exe, like for example, to kill firefox just key in : tskill firefox. Hope this helps!
Thanks Raymond – always something to learn here. HL is my favourite too and I have several of them to install when I do my long overdue fdisk/format/clean install XP Prof.
I have the same hang problem (along with a million other users who M$crap studiously refuse to help by resolving an issue well documented for some 3 years now) with Live Messenger. Can you or one of your fans tell me if this hotkey ploy works with Messenger?
In Vista, you can launch a elevated system taskmanager in the security options dialog:
erwin.ried.cl/?modo=visor&elemento=251
This only works if the game process show up in task manager. Some game protections hide their processes like a rootkit.
very useful tip.
thx u
old but great tip, not all people know it.
Thanks Raymond.
Regards,
Hardy
dont work on most games.. just older crap
You may want to add /F because if the game hangs that command might not work.. (/F = Force”
It seems that command prompt is unable to recognize the command. I guess that’s the problem…. In any case, thanks for the tip Raymond! You rock!
I know this isn’t related, but cud u pls write an article on removal of the virus named “New folder.exe”, pretty tricky one, been on my comp for days now!
Great thing to know in the future! Thanks Raymond.
Very Useful. Thanks!
Try running command prompt and type the command taskkill.exe /IM firefox.exe and see if it closes Firefox.
I’ll try it later, but I’ve tried it on firefox and the same thing happens, nothing! Firefox still runs even after the command! Could the command be prevented due to the influence of an antivirus? Im using kaspersky.
No Jayhan, the command works even when Counter Strike is running. Hmm, I am wondering maybe the game has some kind of protection against game loaders so external commands can’t kill the process? Have you tried GameMinimizer suggested by Mojo?
I’ve always wondered about the game not minimizing.
Thanks for the tip
Hmmm, does the command only work if a game hangs? Because I’ve tried testing it on one of the games I’m playing, it doesn’t seem to terminate the process. I see the command prompt window poping up, but my game still runs afterwards. What seems to be the problem?
thanks for the Tip Ray
Thanks Mojo! Always learn about new apps from you!
Or you can use GameMinimizer if you play more then just one game: mystercrowley.com/sw_gm_en.php
Thanks again Raymond, nice tip, i always used to restart manually before, but now i dont have to!