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.