Windows operating system provides services in order to complete tasks in the foreground. There may become different types of job services in order to accomplish tasks like printing, network authentication, encryption, etc. Windows provides a lot of services by default. But more services can be added by third-party applications or other tools. services.msc is a shortcut to the service management console. In this tutorial, we will look at how to open and manage services with services.msc
.
Windows操作系统提供服务以在前台完成任务。 为了完成诸如打印,网络身份验证,加密等任务,可能会出现不同类型的作业服务。Windows默认提供许多服务。 但是,第三方应用程序或其他工具可以添加更多服务。 services.msc是服务管理控制台的快捷方式。 在本教程中,我们将研究如何使用services.msc
打开和管理services.msc
。
打开Windows服务管理器 (Open Windows Services Manager)
Services Manager is used to managing operating systems services. There are different ways to open the Services Manager.
Services Manager用于管理操作系统服务。 有多种打开服务管理器的方法。
By writing Services
to the search we will be listed the Services Manager
. This will work with Recent Windows Operating systems like Windows 8, Windows 10, Windows Server 2012, Windows Server 2016.
通过将Services
写到搜索中,我们将被列为Services Manager
。 这将与最近的Windows操作系统(例如Windows 8,Windows 10,Windows Server 2012,Windows Server 2016)一起使用。

More compatible way to open Service Manager is running services.msc
command in the Run
. This will work all windows versions like Windows XP, Windows Vista, Windows 8, Windows 10, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows Server 2016.
打开Service Manager的更兼容的方法是在Run
运行services.msc
命令。 这将适用于所有Windows版本,例如Windows XP,Windows Vista,Windows 8,Windows 10,Windows Server 2003,Windows Server 2008,Windows Server 2012和Windows Server 2016。

显示/显示服务状态(Show/Display Service Status)
After opening the Services Manager panel we will see a lot of services that are in a different states. There is two basic services status type
打开“服务管理器”面板后,我们将看到许多处于不同状态的服务。 有两种基本服务状态类型
- Running means services is running as expected正在运行表示服务正在按预期运行
- Stopped means services is not running and active.停止表示服务未运行且处于活动状态。

We can see from screenshot that Service like Application Information
is running without a problem. but service BranchCache
is stopped and not running.
从屏幕截图中我们可以看到,诸如Application Information
类的服务正在正常运行。 但是服务BranchCache
已停止且未运行。
使用GUI更改服务状态 (Change Service Status with GUI)
We can change the service status. We can start or stop a service with net
command which is provided by the operating system. But as you expect we need Administrator
privileges in order to start and stop the service. We can use GUI too in order to manage Windows services with related buttons like start, stop, resume, etc. after select relevant service from the list.
我们可以更改服务状态。 我们可以使用操作系统提供的net
命令启动或停止服务。 但是正如您所期望的,我们需要Administrator
特权才能启动和停止服务。 从列表中选择相关服务后,我们也可以使用GUI来通过相关按钮(例如开始,停止,继续等)来管理Windows服务。
For command line we need open a Administrator
pribileged MSDOS or Powershell. Just right click to the opened box and Run as administrator
.
对于命令行,我们需要打开Administrator
专有的MSDOS或Powershell。 只需右键单击打开的框,然后Run as administrator
。

在命令行中显示Windows服务状态 (Show Windows Service Status In Command Line)
We will use sc
command which is the main tool used to manage windows service. We will use query
parameter in order to list given service status. We will list service named Application Info
which is named as Appinfo
in windows services.
我们将使用sc
命令,这是用于管理Windows服务的主要工具。 我们将使用query
参数来列出给定的服务状态。 我们将列出名为Application Info
服务,该服务在Windows服务中称为Appinfo
。
> sc query Appinfo

As we can see from screenshot it has type 30 which is a Win32 service.
从屏幕截图中可以看到,它的类型为30,这是Win32服务。
在命令行中启动Windows服务 (Start Windows Service In Command Line)
We will use sc
command with start
parameter and service name in order to start the service named Appinfo
.
我们将使用带有start
参数和服务名称的sc
命令来启动名为Appinfo
的服务。
> sc start Appinfo
在命令行中停止Windows服务 (Stop Windows Service In Command Line)
We can stop the service with stop
parameter. But keep in mind that some services may take some time to stop. After stopped the related session state of the session will be lost.
我们可以使用stop
参数停止服务。 但是请记住,某些服务可能需要一些时间才能停止。 停止后,会话的相关会话状态将丢失。
> sc stop Appinfo
在命令行中暂停Windows Server (Pause windows Server In Command Line)
Another state of windows service is pause state which is rarely used. We can pause service for a short time.
Windows服务的另一个状态是很少使用的暂停状态。 我们可以在短时间内暂停服务。
> sc pause Appinfo
在命令行中恢复Windows服务 (Resume Windows Service In Command Line)
We need also resume paused windows service. We can use resume
paramter for this.
我们还需要恢复暂停的Windows服务。 我们可以为此使用resume
参数。
> sc resume Appinfo
启动时启动服务 (Start Service On Boot)
Services are started after a reboot automatically if they are set enabled. If not and set to Manual start we need to start them manually. We can enable auto service to start after a reboot with config
command like below.
如果将服务设置为启用,则它们将在重新引导后自动启动。 如果未设置为手动启动,则需要手动启动它们。 我们可以使用如下所示的config
命令启用自动服务以在重启后启动。
> sc config "Appinfo" start=enabled
翻译自: https://www.poftut.com/how-to-manage-windows-services-with-services-msc/