This procedure also works in Windows XP and Windows Vista.
To generate a list of running processes, open the Command Prompt as Administrator. To do this in Windows 7 or Windows Vista, enter “cmd” (without the quotes) in the Search Programs and Files box on the Start menu. The cmd.exe program should automatically be highlighted in the Programs section of the results. Press Ctrl + Shift + Enter to open cmd.exe as Administrator.
You can also open the Command Prompt as Administrator in Windows 7 or Windows Vista by opening All Programs | Accessories on the Start menu. Right-click on the Command Prompt shortcut and select Run as administrator from the popup menu.
If you are using Windows XP, open All Programs | Accessories on the Start menu. Right-click on the Command Prompt shortcut and select Run as from the popup menu.
The Run As dialog box displays. Select the The following user radio button and select Administrator from the User name drop-down list, if it is not already selected. Enter the Administrator password in the Password edit box. Click OK.
If you are using Windows 7 and the User Account Control dialog box displays, click Yes to continue.
NOTE: You may not see this dialog box, depending on your User Account Control.
To see the list of running processes directly in the Command Prompt window, enter the following line at the prompt and press Enter.
tasklistA nice table with headings displays all the running processes.
To write the table of running processes to a text file, enter the following line at the prompt and press Enter.
tasklist > c:\processes_list.txtNOTE: The above command saves a file called processes_list.txt to C:. If you want to save the file with a different name to a different location, enter the full path of the desired location and enter a different file name.
In our example, the processes_list.txt file is written to the root of the C: drive.
The table of running processes is available in text file format, allowing you to print the information from a text editor, such as Notepad.
You can also generate a list of running services in the same manner. To do this, enter the following line at the prompt and press Enter.
tasklist/svc > c:\services_list.txtNOTE: Again, you can change the path and filename as desired.
A table displays the list of services with their associated PIDs.
NOTE: This is a good way to find out what services are being hosted by the various instances of the svchost.exe file. Svchost.exe is a process that hosts other services to perform various functions and there can be multiple instances of svchost.exe running at one time. See our post, Svchost.exe explained and demystified, for more information about svchost.exe.
This procedure can come in handy if you need to kill a process and a virus is preventing Task Manager from opening. You can generate the list of running processes in the command prompt, get the PID for the process you want to kill, and then use the taskkill command to kill the process. Enter the following line on the command prompt for more information on how to use the taskkill command.
taskkill /?Also, see our post, Quickly Kill Non-Responsive Programs in Windows 7 and Vista, for an easy way to kill non-responsive processes. The article was written about Windows 7 and Vista, but the taskkill command is also available in Windows XP.
No comments:
Post a Comment