Svchost.exe是一个托管其他执行各种系统功能的Windows服务的进程。(Windows)您的计算机上可以运行多个svchost.exe实例,每个实例包含不同的服务。不久前,我们发表了一篇文章,介绍如果svchost.exe 占用大量 CPU 时(svchost.exe is using up a high percentage of your CPU)您可以做什么。
在本文中,我将向您展示几种查看在 svchost.exe 中运行的实际进程或服务的方法。在大多数Windows PC(Windows PCs)上,您会看到 10 到 20 个这样的进程在运行。如果出现问题并且某个特定的 svchost.exe 进程引起了问题,那么一旦您知道该进程中正在运行哪个服务,您就可以轻松修复它。
任务管理器
如果您正在运行Windows 10,那么您只需查看任务管理器即可。单击(Click)开始并在任务管理器中(Start)键入,或者只需按住键盘上的CTRL + SHIFT + ESC。这将调出任务管理器。如果您只看到一个包含当前正在运行的程序列表的小框,请确保单击底部的更多详细信息。( More details)
然后单击Processes选项卡并滚动过去Apps and Background Processes直到您到达Windows Processes。继续向下滚动,直到您开始看到Service Host:。应该列出不少。
如您所见,每个服务主机都会在分号后面列出服务的名称。这使得查看哪个服务与哪个 svchost.exe 进程相关联变得非常容易。如果您需要查看确切的进程 ID,只需右键单击该行并选择Go to details。
这将自动将您带到详细信息(Details)选项卡,它将自动选择与该过程对应的行。
现在我们可以看到DHCP 客户端(DHCP Client)服务在 svchost.exe 中运行,进程 ID 为 1504。这是迄今为止完成此任务的最简单方法,但它需要 Windows 10。如果您运行的是Windows 7或更早版本,请阅读关于其他方法。
任务列表命令
在任何版本的Windows上,您都可以使用命令行生成所有 svchost.exe 进程的列表以及每个进程中运行的服务。为此,只需单击开始(Start)并输入cmd打开命令提示符。
在命令提示符下,继续复制/粘贴以下命令:
tasklist /svc | find "svchost.exe"
这将生成所有正在运行的进程的列表,将该列表传递给 find 命令并过滤以仅显示 svchost.exe 进程。如果要将其输出到文本文件,请使用以下命令:
tasklist /svc | find "svchost.exe" > c:\tasklist.txt
请注意,为了输出到 C 驱动器的根目录,您需要打开管理员(Administrator)命令提示符(开始(Start),键入 cmd,右键单击命令提示符并选择以管理员身份运行( Run as Administrator))。如果它更容易,您可以将路径更改为C:\Users\username\Documents之类的其他内容。
进程浏览器
最后,您可以使用Microsoft(Microsoft)的第三方程序Process Explorer(Process Explorer)。只需(Just)下载它,解压缩并运行EXE文件。无需安装任何东西,很方便。
单击进程列的标题以对进程(Process)列表进行排序,然后向下滚动直到看到 svchost.exe。继续将鼠标悬停在任何进程上,它将向您显示与该进程关联的服务。
因此,这些是了解更多关于 svchost.exe 进程以及每个进程内部运行的内容的一些简单易行的方法。享受!
View the List of Services Hosted by the svchost.exe Process in Windows
Svchost.exe is a process that hosts other Windows services that perform various system functions. There can be multiple instances of svchost.exe running on your computer, with each instance containing a different service. We published a post a while back on what you can do if svchost.exe is using up a high percentage of your CPU.
In this article, I’m going to show you a couple of ways you view the actual process or service that is running inside svchost.exe. On most Windows PCs, you’ll see anywhere from 10 to 20 of these processes running. If there is a problem and one particular svchost.exe process is causing issues, you can probably fix it easily once you know which service is running inside that process.
Task Manager
If you are running Windows 10, then you have to look no further than the task manager. Click on Start and type in task manager or just press and hold CTRL + SHIFT + ESC on the keyboard. This will bring up task manager. If you just see a small box with a list of currently running programs, make sure to click on More details at the bottom.
Then click on the Processes tab and scroll past Apps and Background Processes until you get to Windows Processes. Keep scrolling down until you start seeing Service Host:. There should be quite a few of them listed.
As you can see, each service host will have the name of the service listed after the semicolon. This makes it really easy to see which service is associated with which svchost.exe process. If you need to see the exact process ID, just right-click on the line and choose Go to details.
This will automatically bring you to the Details tab and it will automatically select the line that corresponds to that process.
Now we can see that the DHCP Client service is running inside svchost.exe with a process ID of 1504. This is by far the easiest way to accomplish this task, but it requires Windows 10. If you are running Windows 7 or earlier, read on about other methods.
Tasklist Command
On any version of Windows, you can use the command line to generate a list of all the svchost.exe processes along with the service that is running inside each. To do this, simply open a command prompt by clicking on Start and typing in cmd.
At the command prompt, go ahead and copy/paste the following command:
tasklist /svc | find "svchost.exe"
This will generate a list of all running processes, pass that list to the find command and filter to only show the svchost.exe processes. If you want to output this to a text file, use the following command:
tasklist /svc | find "svchost.exe" > c:\tasklist.txt
Note that in order to output to the root of the C drive, you’ll need to open an Administrator command prompt (Start, type cmd, right-click on command prompt and choose Run as Administrator). If it’s easier, you can change the path to something else like C:\Users\username\Documents.
Process Explorer
Finally, you can use a third-party program from Microsoft called Process Explorer. Just download it, unzip it and run the EXE file. There is no need to install anything, which is convenient.
Click on the header for the Process column to sort the list of processes and then scroll down till you see svchost.exe. Go ahead and hover your mouse over any process and it will show you the services that are associated with that process.
So those are a couple of simple and easy ways to learn more about the svchost.exe process and what is running inside each one. Enjoy!