Tuesday, November 17, 2009

Killing tasks/processes from the command line in Windows 7

Sometimes you quickly need to kill a task in Windows (mostly from the command line). With Windows 7 this can be done by using the taskkill command. First thing you need to do is start a command line with administrative priviledges:

Type in command in the start menu, when the Command Prompt shows up, right click and select Run as Administrator.


 


After a warning message (if UAC is turned on), the command line is shown. Before we kill something, we need to know what we would like to kill :). This can be done by issuing a tasklist command.



The tasklist command will show all the running tasks (similar to task manager). This list can be quite long depending on your system. You can quickly filter by issuing the /M switch, eg.

taskkill /M vm*

will show all tasks (and modules) starting with vm in the name

Now killing the task is the easy part. Just issue a taskkill /IM with the name of the task:



The /IM specifies that we are using the image name and the /F at the end is used to specify we would like to kill the process forcefully. You can also kill a task by PID (process id) by using the /PID instead of /IM. It also allows you to kill multiple tasks eg:

taskkill /PID 230 349 230 /F

will kill processes 230, 349 and 230 simultaneously. The taskkill has much more functionality, eg killing multiple task based on filters, for example:

taskkill /IM note* /FI "windowtitle eq untitle*"
 

will kill every task name starting with note (eg notepad) and where the title starts with untitle, with other word kill all instances of empty notepad.

Enjoy!




Monday, November 9, 2009

Cisco VPN 5.0.00.340 after Windows 7 Update

2 weeks ago I have updated my laptop to Windows 7 and today I wanted to use my VPN account. When trying to connect, I got an error 440 Driver Failure. Fixing this issue was quite easy, however you do need to have the Cisco VPN installation files.

Goto start, type "add remove"  and select Add or Remove programs



From the list of installed applications, scroll to the Cisco VPN item and press repair.



If your original installation files are still in the same folder, all will go well, otherwise you will get a popup screen asking for the installation files. Luckily I have my backup and it was easy to find them :)
It works like a charm now!