批处理禁用和启用服务
来源:百度文库 编辑:神马文学网 时间:2024/04/28 05:21:34
2009年12月22日 星期二 下午 02:22
批处理利用sc禁用和启用服务
sc config 服务名称 start= auto(自动)
sc config 服务名称 start= demand(手动)
sc config 服务名称 start= disabled(禁用)
然后配合 net start 服务名称或者 net stop 服务名称 来使用
例子:
sc config shellhwdetection start= disabled 禁用shellhwdetection服务。
sc config shellhwdetection start= auto 设置shellhwdetection服务自动启动。
sc config shellhwdetection start= demand 设置shellhwdetection服务手动启动。
sc start shellhwdetection 启动shellhwdetection服务。
sc stop shellhwdetection 停止shellhwdetection服务。
sc delete shellhwdetection 删除shellhwdetection服务。
sc create Tomcat binPath= F:\apache-tomcat\bin\startup.bat start= auto 添加Tomcat服务。
sc config MSSQL$SQLEXPRESS start= auto 设置SQL Server (SQLEXPRESS)服务自动启动
sc config MSSQL$SQLEXPRESS start= demand 设置SQL Server (SQLEXPRESS)服务手动启动
sc config MSSQL$SQLEXPRESS start= disabled 禁用SQL Server (SQLEXPRESS)服务
net start "SQL Server (SQLEXPRESS)" 启动SQL Server (SQLEXPRESS)服务
net stop "SQL Server (SQLEXPRESS)" 停止SQL Server (SQLEXPRESS)服务
net pause "SQL Server (SQLEXPRESS)" 暂停SQL Server (SQLEXPRESS)服务
(如果服务名由两个或多个单词组成,必须用引号把该服务名圈起来,如:sc config "ECShop httpd" start= demand)
sc config MSISerer start= demand & net start "Windows Installer"
意思是:将 Windows Installer 服务设置为手动并启动该服务(Windows Installer的真实服务名是MSISerer)
注:
★★1)服务名不一定是你在服务面板看到的那个名。
例如,你要打开被禁用的telnet服务,sc config telnet start= auto,会报错:[SC] OpenService FAILED 1060,因为telnet的服务名不是telnet而是tlntsvr,改为sc config tlntsvr start= auto就OK了,在服务里查看telnet服务的属性,在属性框的最上面可看到真正的服务名,即命令中的服务名。
2)start=后面有一个空格,如果不加这个空格,命令就无法执行,而且连错误提示也没有, 等号后加一个空格就好了.
其它见微软官方说明:
http://technet.microsoft.com/zh-cn/library/cc772676(WS.10).aspx#BKMK_config
或参考:http://xygood.blog.163.com/blog/static/1135326672009713111830695/
批处理利用sc禁用和启用服务
sc config 服务名称 start= auto(自动)
sc config 服务名称 start= demand(手动)
sc config 服务名称 start= disabled(禁用)
然后配合 net start 服务名称或者 net stop 服务名称 来使用
例子:
sc config shellhwdetection start= disabled 禁用shellhwdetection服务。
sc config shellhwdetection start= auto 设置shellhwdetection服务自动启动。
sc config shellhwdetection start= demand 设置shellhwdetection服务手动启动。
sc start shellhwdetection 启动shellhwdetection服务。
sc stop shellhwdetection 停止shellhwdetection服务。
sc delete shellhwdetection 删除shellhwdetection服务。
sc create Tomcat binPath= F:\apache-tomcat\bin\startup.bat start= auto 添加Tomcat服务。
sc config MSSQL$SQLEXPRESS start= auto 设置SQL Server (SQLEXPRESS)服务自动启动
sc config MSSQL$SQLEXPRESS start= demand 设置SQL Server (SQLEXPRESS)服务手动启动
sc config MSSQL$SQLEXPRESS start= disabled 禁用SQL Server (SQLEXPRESS)服务
net start "SQL Server (SQLEXPRESS)" 启动SQL Server (SQLEXPRESS)服务
net stop "SQL Server (SQLEXPRESS)" 停止SQL Server (SQLEXPRESS)服务
net pause "SQL Server (SQLEXPRESS)" 暂停SQL Server (SQLEXPRESS)服务
(如果服务名由两个或多个单词组成,必须用引号把该服务名圈起来,如:sc config "ECShop httpd" start= demand)
sc config MSISerer start= demand & net start "Windows Installer"
意思是:将 Windows Installer 服务设置为手动并启动该服务(Windows Installer的真实服务名是MSISerer)
注:
★★1)服务名不一定是你在服务面板看到的那个名。
例如,你要打开被禁用的telnet服务,sc config telnet start= auto,会报错:[SC] OpenService FAILED 1060,因为telnet的服务名不是telnet而是tlntsvr,改为sc config tlntsvr start= auto就OK了,在服务里查看telnet服务的属性,在属性框的最上面可看到真正的服务名,即命令中的服务名。
2)start=后面有一个空格,如果不加这个空格,命令就无法执行,而且连错误提示也没有, 等号后加一个空格就好了.
其它见微软官方说明:
http://technet.microsoft.com/zh-cn/library/cc772676(WS.10).aspx#BKMK_config
或参考:http://xygood.blog.163.com/blog/static/1135326672009713111830695/
批处理禁用和启用服务
批处理禁用和启用服务
利用批处理禁用(启用)组策略
利用批处理禁用(启用)组策略
windows xp 启用,禁用 拖放
Redhat as 3以上启用 Telnet 和 FTP 服务
禁用和启用网卡.使用windows DDK - David liao Stl C - ...
如何启用-禁用?Ubuntu?中的?root?帐号
在线Ping服务批处理地址
使用 SDO 和 JDBC Data Access Service 启用面向服务的体系结构
使用 SDO 和 JDBC Data Access Service 启用面向服务的体系结构
禁用/启用Windows 7中的任务栏窗口预览 - qqread.com
启动被禁用的RPC服务
WindowsXP可被禁用的服务
第十课:动作和批处理
批处理
批处理
C#实现启用、禁用本地网络的三种方式 - dsd999的专栏 - CSDN博客
C#实现启用、禁用本地网络的三种方式 - dsd999的专栏 - CSDN博客
首批政府网启用中文域名 专门服务网站开通
Windows XP中必须启用的10个服务
Java如何调用可执行文件和批处理命令
银行存款日记账的启用和登记
XP中可以被禁用的服务对照表