February 5, 2011

Kill rogue processes with taskkill in Microsoft Windows

There are times, regardless of your operating system, when you will need to manually kill a rogue process. Most of the time, this can easily be done with the help of the Microsoft Windows 7 Task Manager. There are times, however, when that tool doesn’t seem to have the ability to kill a rogue process. I have seen this plenty of times when trying to kill an Acronis process that has gone astray. When this happens, I have to employ a more powerful tool, taskkill, which is used from the command line.



Best online Microsoft MCTS Training, Microsoft MCITP Training at certkingdom.com


Note: In order to run the taskkill command, you will have to open the command window. To do this, click Start | Run and type cmd in the text field or just enter cmd in the Run dialog box (access Run dialog box by clicking Win+R) (Figure A).

Figure A
Open the command window.

Stay on top of the latest Microsoft Windows tips and tricks with TechRepublic’s Windows Desktop newsletter, delivered every Monday and Thursday. Automatically sign up today!

Using taskkill
The general syntax of the command looks like this:

taskkill [OPTIONS] [PID]

As you might expect, there are plenty of options available for this command. Some of the more helpful options are:

* /s COMPUTER — (Where COMPUTER is the IP or address of a remote computer). The default is the local computer, so if you’re working with a command on the local machine, you do not have to use this option.
* /u DOMAIN\USER — (Where DOMAIN is the domain and USER is the username you authenticate to). This option allows you run taskkill with the account permissions of the specified USERNAME or DOMAIN\USERNAME.
* /p — If you use the /u option, you will also need to include the /p option, which allows you to specify the user password.
* /fi — Allows you to run the taskkill command with filters.
* /f — Forces the command to be terminated.
* /IM — Allows you to use an application name instead of the PID (Process ID number) of the application.

One of the most useful options is the help switch (Figure B):

taskkill /?

Figure B
Use the help switch for the taskkill command.
Killing with application name
The simplest way to kill a rogue application with taskkill is using the /IM option. This is done like so:

taskkill /IM APPLICATION_NAME

Where APPLICATION_NAME is the name of the application you want to kill. Say, for example, Outlook is refusing to close. To close this with taskkill, you would execute the command:

taskkill /IM outlook.exe

Killing with PID
Let’s say you do not know the name of the application, but instead you know the PID of the application. To kill a process with a PID of, say, 572, you would issue the command:

taskkill /PID 572

Killing all processes owned by a particular user
What if you want to kill all processes owned by a single user? This can come in handy if something has gone awry with a user account or if the user has logged out, but some of the processes owned by that user will not go away. To manage this you would issue the taskkill command like so:

taskkill /F /FI “USERNAME eq username”

In this case, the username is the actual username that owns the processes. Note: The USERNAME option must be used in order to tell the taskkill command a username will be specified.

Killing processes on a remote machine
This one is very handy. Say something has locked up your desktop and you know exactly what application is the culprit. Let’s stick with our Outlook example from earlier. You can hop onto another machine and remotely kill that application like so:

taskkill /s IP_ADDRESS /u DOMAIN\USERNAME /IM Outlook.exe

Where IP_ADDRESS is the address of the remote machine (Note: The hostname can be substituted if the machines are able to see one another by hostname), DOMAIN is the domain (if applicable), and USERNAME is the username used to authenticate to the remote machine.

Final thoughts
The ability and power that comes with the taskkill command can be a very valuable tool that might save you from having to forcibly reboot a machine. Having a solid grasp of this tool, in conjunction with using the Windows Task Manager, will help to keep your Windows machines enjoying longer uptime and, should the occasion strike, the ability to manage a task when a virus, rootkit, or trojan has taken over your machine.

10 predictions for Windows 8

Although there have been numerous rumors regarding what we can expect from Windows 8, Microsoft has revealed very few concrete details. So I wanted to take the opportunity to present my predictions. Before I do however, I need to point out that most of these predictions are pure speculation on my part. I have no inside information from Redmond, nor do I claim to have a crystal ball.

Best online Microsoft MCTS Training, Microsoft MCITP Training at certkingdom.com



1: ARM support
The one firm detail that Microsoft has released is that Windows 8 will support the ARM architecture. ARM processors are common in various consumer electronics devices, and it seems clear that Microsoft is positioning itself to allow Windows 8 to run on PCs, tablets, and cell phones.

2: Separation from the server
Before the days of Windows XP, Windows Server and the Windows desktop clients were two completely different operating systems. In recent years, Microsoft has tried to cut development costs by designing its desktop and server operating systems to use the same kernel. Even so, I think we may see Microsoft make a departure from the strategy. In my opinion, Windows client operating systems (especially with the newly announced ARM support) are simply becoming too different from Windows Server operating systems. I think Microsoft will eventually have no choice but to resume completely separate development cycles. Whether this happens in the Windows 8 timeframe remains to be seen, though.

3: OS on a diet
For as long as I can remember, people have complained that Windows is an overly bloated operating system. Since Microsoft is going to design Windows 8 to run equally well on PCs and devices with ARM processors, I think that it will have no choice but to trim down the operating system.

Consumers have been driven to adopt tablets and other mobile devices because of their speed, simplicity, and the fact that they boot instantly. Windows 7 is far too bloated to meet any of these expectations. Therefore, if Microsoft wants to use Windows 8 on mobile devices, it will have to get rid of many of the things that make Windows 7 so bloated and inefficient.

4: Goodbye to 32-bit support
Even though there are rumors to the contrary, I expect Microsoft to do away with 32-bit support in Windows 8. Every PC that has been manufactured in the last several years includes a 64-bit processor. There is absolutely no reason why a brand-new operating system needs to continue to support legacy 32-bit hardware.

Whether Windows 8 will support 32-bit applications remains to be seen. In the previous item, I mentioned that Microsoft needs to design Windows 8 to make it less bloated and more efficient. One of the easiest ways Microsoft could do this would be to design the kernel so that it runs only 64-bit applications. However, there are still so many 32-bit applications in use, I think Microsoft will continue to provide support for those applications, even if it’s not in a traditional way.

5: Virtual plug-ins
Believe it or not, I think that Windows 7 was actually a model for Windows 8 in some ways. As you will recall, Microsoft offers something called Windows XP mode in some editions of Windows 7. With Windows XP mode, Windows XP runs as a virtual machine, but in a rather unique way. Users can either use the Windows XP desktop or they can run applications transparently through the Windows 7 desktop, even though those applications are actually running on Windows XP.

I think that Microsoft may bring the same model to Windows 8. Rather than provide backward compatibility to legacy operating systems within the Windows a kernel, Microsoft may create virtual instances of legacy operating systems (including 32-bit operating systems) that function as plug-ins to Windows 8. This would be an ideal solution because this approach would help keep the Windows 8 kernel small and efficient, while still providing a means of achieving backward compatibility for those who need it.

6: Heavy reliance on the cloud
This past summer at TechEd in New Orleans, Microsoft placed extremely heavy emphasis on cloud computing. I don’t expect Microsoft to completely abandon its cloud focus just because it has a new desktop operating system on the horizon. Instead, I look for Windows 8 to include heavy cloud integration. For example, I think that Windows 8 will probably provide the ability to make cloud applications appear to users as if they are installed and running locally.

7: Native support for virtualized apps
I think we can expect Windows 8 to offer native support for virtualized applications. Among these applications, I think Windows 8 will be designed to run Internet Explorer in a sandbox. This would help put an end to all the security issues that Microsoft has previously had with the browser, because virtualizing and sandboxing Internet Explorer would prevent malicious Web sites from infecting the core operating system. It may even be possible to reset Internet Explorer to a pristine state after each use.

8: A bigger distinction between consumer and enterprise versions
Ever since Windows XP, Microsoft has offered different editions of its desktop operating systems with at least one version geared toward consumers and another toward businesses. I think that in Windows 8, we will see a greater distinction between the consumer and enterprise editions than ever before.

If my prediction about the core operating system being small and efficient holds true, I think that Microsoft will market the lightweight OS to businesses as being more secure than previous versions of Windows because of its smaller footprint. At the same time, though, I doubt that Microsoft will be able to resist the temptation to load up the consumer version with unnecessary software, such as software to provide native support for Zune.

9: Using hardware to drive sales
One thing that was abundantly clear from the Consumer Electronics Show in Las Vegas this year is that the PC is in real trouble. Consumers have begun to shy away from purchasing desktops and laptops in favor of purchasing tablet devices. As a result, I look for Microsoft to use native operating system support for specialized hardware to try to woo customers back to the PC. For example, I think we will see an adaptation of Microsoft Kinect for the PC, which will allow interacting with the PC via hand gestures. Just how practical it will be to work with a PC in this manner remains to be seen, but I think it will make a great marketing gimmick.

10: Name change
Even though everyone has been using the name Windows 8, I don’t think that will be the official name of the new operating system. At the moment, Microsoft has a serious image problem. It’s perceived by many as being out of touch and late to the party. While other companies are focusing on tablets and mobile devices, Microsoft is still writing software for the PC. I think that in an effort to lose its dated image, Microsoft may rebrand Windows as something completely different. It might even lose the name Windows.

If you think this sounds farfetched, consider what recently happened with Microsoft Flight Simulator. Flight Simulator has been around for roughly 30 years, which puts its longevity more or less on par with Windows. Even so, Microsoft has announced that the next edition will be called Microsoft Flight. It is rebranding the product to try to change its image in order to attract gamers and not just pilots (or aspiring pilots).

Your predictions
Do you agree with the possibilities outlined here? Join the discussion and share your own Windows 8 prophesies.
Bookmark and Share