fbpx
维基百科

Windows服务

Windows服务是指Windows NT操作系统中的一种运行在后台的计算机程序。[1]它在概念上类似于Unix守护进程[1]Windows服务必须符合服务控制管理器(负责管理Windows服务的组件)的接口规则和协议。[2]

Windows服务可以配置为在操作系统启动时运行,并且在Windows运行期间持续在后台运行。服务也可以手动或基于某个事件而启动。Windows NT操作系统包含众多服务,分别运行在三种用户帐户环境中:系统、网络服务和本地服务。这些Windows组件通常采用Windows服务托管进程。因为Windows服务运行在其自身的专用用户帐户中,它们可以在用户未登录时活动。

Windows Vista之前,安装为“交互服务”的服务可以与Windows桌面交互和显示图形用户界面。但在Windows Vista中,交互服务已被弃用,并且可能无法正常运行。[3][4]

管理 编辑

Windows管理员可以管理服务,通过:

服务扩展 编辑

服务扩展是基于Microsoft管理控制台提供的一个组件,它可以连接到本地计算机或网络上的远程计算机,用户可以:[1]

  • 查看已安装服务的列表,包括服务名称、说明和配置
  • 开始、停止、暂停或重新启动服务[5]
  • 适用时指定服务的参数
  • 更改启动类型。可接受的启动类型有:
    • 自动:服务会在系统登录时启动。
    • 自动(延迟启动):服务会在系统启动后过一会启动。此选项在Windows Vista中引入,目的是降低系统启动后到达桌面的等待时间。但是,不是所有服务都支持延迟启动。[6]
    • 手动:服务只会在被明确调用时启动。
    • 已停用:服务被停用,開機時将不会启动,開機後必須要再設定為自動或手動才能將服務啟用。
  • 更改各服务运行的用户帐户上下文
  • 配置服务发生失败时应采取的恢复操作
  • 查阅服务的依赖关系,了解服务或设备驱动程序依赖于哪些特定服务,或者特定服务依赖于哪些服务或设备驱动程序
  • 导出服务列表为文本文件或CSV文件

Sc.exe 编辑

服务扩展的命令行接口是Sc.exe,名为“服务控制”实用工具。[7]此工具在Windows XP[8]及更高版本中提供。[9]

Sc.exe的管理范围仅限于本地计算机。从Windows Server 2003开始,Sc.exe不仅能做到“服务扩展”支持的操作,还可以安装和卸载服务。[9]

Windows PowerShell 编辑

Windows PowerShell本质上可以管理Windows服务,相关命令如下:

其他管理工具 编辑

在服务扩展、Sc.exe和PowerShell以外,Windows还包括第三方可以操作的组件。Net.exe可以启动、停止、暂停或恢复一个Windows服务。[18]在Windows Vista及更高版本中,Windows 任务管理器可以显示已安装服务的列表和启动与暂停它们。MSConfig可以启用或禁用Windows服务。

开发 编辑

编写原生服务 编辑

可以使用如Microsoft Visual StudioEmbarcadero Delphi等开发工具创建一个Windows服务。为了成为一个Windows服务,程序在编写上必须处理“服务控制管理器”的启动、停止和暂停消息。服务控制管理器是负责启动和停止服务的Windows组件。

封装应用程序为服务 编辑

Windows Resource Kit for Windows NT 3.51Windows NT 4.0Windows 2000提供工具来控制服务的注册和使用:SrvAny.exe作为服务封装器来处理预期的服务接口(例如处理service_start,然后响应service_startedservice_failed)并允许配置任何可执行文件或脚本作为一个服务。Sc.exe可以安装、启动、停止和卸载新服务。[19]

参见 编辑

Windows服务
概念

参考资料 编辑

  1. ^ 1.0 1.1 1.2 . TechNet. Microsoft. [29 March 2013]. (原始内容存档于2016-03-05).  引证错误:带有name属性“Services snap-in”的<ref>标签用不同内容定义了多次 引证错误:带有name属性“Services snap-in”的<ref>标签用不同内容定义了多次
  2. ^ . Microsoft Developer Network. Microsoft. [29 March 2013]. (原始内容存档于2008-04-08). 
  3. ^ . TechNet Magazine. Microsoft. June 2008 [21 June 2013]. (原始内容存档于2016-08-21). The service CmdAsSystem is configured as interactive whose support is being deprecated. The service may not function properly. The problem is that this script tries to create and start an interactive service. Interactive services will not function correctly due to Session 0 Isolation in Windows Vista. 
  4. ^ . MSDN. Microsoft. 18 October 2010 [21 June 2013]. (原始内容存档于2013-12-24). 
  5. ^ . TechNet. Microsoft. [29 March 2013]. (原始内容存档于2016-07-14). 
  6. ^ . Microsoft. [April 2013]. (原始内容存档于2017-12-01)See Remarks section 
  7. ^ . Support. Microsoft. 11 September 2011 [29 March 2013]. (原始内容存档于2015-03-03). 
  8. ^ . TechNet. Microsoft. [8 January 2014]. (原始内容存档于2018-02-03). 
  9. ^ 9.0 9.1 . TechNet. Microsoft. [8 January 2014]. (原始内容存档于2017-08-26). Windows 7, Windows 8, Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Vista  引证错误:带有name属性“sc.exe”的<ref>标签用不同内容定义了多次
  10. ^ . TechNet. Microsoft. [29 March 2013]. (原始内容存档于2016-03-08). 
  11. ^ . TechNet. Microsoft. [29 March 2013]. (原始内容存档于2016-10-25). 
  12. ^ . TechNet. Microsoft. [29 March 2013]. (原始内容存档于2016-10-25). 
  13. ^ . TechNet. Microsoft. [29 March 2013]. (原始内容存档于2016-10-25). 
  14. ^ . TechNet. Microsoft. [29 March 2013]. (原始内容存档于2016-10-25). 
  15. ^ . TechNet. Microsoft. [29 March 2013]. (原始内容存档于2016-10-25). 
  16. ^ . TechNet. Microsoft. [29 March 2013]. (原始内容存档于2016-10-25). 
  17. ^ . TechNet. Microsoft. [29 March 2013]. (原始内容存档于2016-10-25). 
  18. ^ . TechNet. Microsoft. [8 January 2014]. (原始内容存档于2016-07-14). 
  19. ^ . Support. Microsoft. [29 March 2013]. (原始内容存档于2015-03-02). 

进一步资料 编辑

  • Savill, John. . Windows IT Pro英语Windows IT Pro. Penton Media英语Penton Media. 1999-03-05 [2013-03-29]. (原始内容存档于2013-06-29). 
  • David B. Probert, Windows Service Processes (页面存档备份,存于互联网档案馆
  • Windows Sysinternals: Autoruns for Windows v13.4 (页面存档备份,存于互联网档案馆)—An extremely detailed query of services

windows服务, 是指windows, nt操作系统中的一种运行在后台的计算机程序, 它在概念上类似于unix守护进程, 必须符合服务控制管理器, 负责管理的组件, 的接口规则和协议, 可以配置为在操作系统启动时运行, 并且在windows运行期间持续在后台运行, 服务也可以手动或基于某个事件而启动, windows, nt操作系统包含众多服务, 分别运行在三种用户帐户环境中, 系统, 网络服务和本地服务, 这些windows组件通常采用托管进程, 因为运行在其自身的专用用户帐户中, 它们可以在用户未登录时活动. Windows服务是指Windows NT操作系统中的一种运行在后台的计算机程序 1 它在概念上类似于Unix守护进程 1 Windows服务必须符合服务控制管理器 负责管理Windows服务的组件 的接口规则和协议 2 Windows服务可以配置为在操作系统启动时运行 并且在Windows运行期间持续在后台运行 服务也可以手动或基于某个事件而启动 Windows NT操作系统包含众多服务 分别运行在三种用户帐户环境中 系统 网络服务和本地服务 这些Windows组件通常采用Windows服务托管进程 因为Windows服务运行在其自身的专用用户帐户中 它们可以在用户未登录时活动 在Windows Vista之前 安装为 交互服务 的服务可以与Windows桌面交互和显示图形用户界面 但在Windows Vista中 交互服务已被弃用 并且可能无法正常运行 3 4 目录 1 管理 1 1 服务扩展 1 2 Sc exe 1 3 Windows PowerShell 1 4 其他管理工具 2 开发 2 1 编写原生服务 2 2 封装应用程序为服务 3 参见 4 参考资料 5 进一步资料管理 编辑Windows管理员可以管理服务 通过 服务 扩展 在Windows控制面板的 管理工具 中 Sc exe Windows PowerShell服务扩展 编辑 服务扩展是基于Microsoft管理控制台提供的一个组件 它可以连接到本地计算机或网络上的远程计算机 用户可以 1 查看已安装服务的列表 包括服务名称 说明和配置 开始 停止 暂停或重新启动服务 5 适用时指定服务的参数 更改启动类型 可接受的启动类型有 自动 服务会在系统登录时启动 自动 延迟启动 服务会在系统启动后过一会启动 此选项在Windows Vista中引入 目的是降低系统启动后到达桌面的等待时间 但是 不是所有服务都支持延迟启动 6 手动 服务只会在被明确调用时启动 已停用 服务被停用 開機時将不会启动 開機後必須要再設定為自動或手動才能將服務啟用 更改各服务运行的用户帐户上下文 配置服务发生失败时应采取的恢复操作 查阅服务的依赖关系 了解服务或设备驱动程序依赖于哪些特定服务 或者特定服务依赖于哪些服务或设备驱动程序 导出服务列表为文本文件或CSV文件Sc exe 编辑 服务扩展的命令行接口是Sc exe 名为 服务控制 实用工具 7 此工具在Windows XP 8 及更高版本中提供 9 Sc exe的管理范围仅限于本地计算机 从Windows Server 2003开始 Sc exe不仅能做到 服务扩展 支持的操作 还可以安装和卸载服务 9 Windows PowerShell 编辑 Windows PowerShell本质上可以管理Windows服务 相关命令如下 Get Service 10 New Service 11 Restart Service 12 Resume Service 13 Set Service 14 Start Service 15 Stop Service 16 Suspend Service 17 其他管理工具 编辑 在服务扩展 Sc exe和PowerShell以外 Windows还包括第三方可以操作的组件 Net exe可以启动 停止 暂停或恢复一个Windows服务 18 在Windows Vista及更高版本中 Windows 任务管理器可以显示已安装服务的列表和启动与暂停它们 MSConfig可以启用或禁用Windows服务 开发 编辑编写原生服务 编辑 可以使用如Microsoft Visual Studio或Embarcadero Delphi等开发工具创建一个Windows服务 为了成为一个Windows服务 程序在编写上必须处理 服务控制管理器 的启动 停止和暂停消息 服务控制管理器是负责启动和停止服务的Windows组件 封装应用程序为服务 编辑 Windows Resource Kit for Windows NT 3 51 Windows NT 4 0和Windows 2000提供工具来控制服务的注册和使用 SrvAny exe作为服务封装器来处理预期的服务接口 例如处理service start 然后响应service started或service failed 并允许配置任何可执行文件或脚本作为一个服务 Sc exe可以安装 启动 停止和卸载新服务 19 参见 编辑Windows服务svchost exe概念后台进程 守护进程 驱动程序参考资料 编辑 1 0 1 1 1 2 Services overview TechNet Microsoft 29 March 2013 原始内容存档于2016 03 05 引证错误 带有name属性 Services snap in 的 lt ref gt 标签用不同内容定义了多次 引证错误 带有name属性 Services snap in 的 lt ref gt 标签用不同内容定义了多次 Services Microsoft Developer Network Microsoft 29 March 2013 原始内容存档于2008 04 08 New Elevation PowerToys for Windows Vista TechNet Magazine Microsoft June 2008 21 June 2013 原始内容存档于2016 08 21 The service CmdAsSystem is configured as interactive whose support is being deprecated The service may not function properly The problem is that this script tries to create and start an interactive service Interactive services will not function correctly due to Session 0 Isolation in Windows Vista Services in Windows MSDN Microsoft 18 October 2010 21 June 2013 原始内容存档于2013 12 24 Start stop pause resume or restart a service TechNet Microsoft 29 March 2013 原始内容存档于2016 07 14 ServiceInstaller DelayedAutoStart Property System ServiceProcess Microsoft April 2013 原始内容存档于2017 12 01 See Remarks section How to create a Windows service by using Sc exe Support Microsoft 11 September 2011 29 March 2013 原始内容存档于2015 03 03 Command line reference A Z SC TechNet Microsoft 8 January 2014 原始内容存档于2018 02 03 9 0 9 1 Command Line Reference Sc TechNet Microsoft 8 January 2014 原始内容存档于2017 08 26 Windows 7 Windows 8 Windows Server 2003 Windows Server 2003 R2 Windows Server 2003 with SP1 Windows Server 2003 with SP2 Windows Server 2008 Windows Server 2008 R2 Windows Server 2012 Windows Vista 引证错误 带有name属性 sc exe 的 lt ref gt 标签用不同内容定义了多次 Get Service TechNet Microsoft 29 March 2013 原始内容存档于2016 03 08 New Service TechNet Microsoft 29 March 2013 原始内容存档于2016 10 25 Restart Service TechNet Microsoft 29 March 2013 原始内容存档于2016 10 25 Resume Service TechNet Microsoft 29 March 2013 原始内容存档于2016 10 25 Set Service TechNet Microsoft 29 March 2013 原始内容存档于2016 10 25 Start Service TechNet Microsoft 29 March 2013 原始内容存档于2016 10 25 Stop Service TechNet Microsoft 29 March 2013 原始内容存档于2016 10 25 Suspend Service TechNet Microsoft 29 March 2013 原始内容存档于2016 10 25 Start stop pause resume or restart a service TechNet Microsoft 8 January 2014 原始内容存档于2016 07 14 How To Create a User Defined Service Support Microsoft 29 March 2013 原始内容存档于2015 03 02 进一步资料 编辑Savill John What are the ErrorControl Start and Type values under the Services subkeys Windows IT Pro 英语 Windows IT Pro Penton Media 英语 Penton Media 1999 03 05 2013 03 29 原始内容存档于2013 06 29 David B Probert Windows Service Processes 页面存档备份 存于互联网档案馆 Windows Sysinternals Autoruns for Windows v13 4 页面存档备份 存于互联网档案馆 An extremely detailed query of services 取自 https zh wikipedia org w index php title Windows服务 amp oldid 71702950, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。