使用添加删除windows的系统服务的例子
2012-12-30 20:49
706 查看
使用SC 工具可以进行windows服务的添加和删除。步骤如下:
如需要添加一个服务,至少需要知道服务名称,可执行程序,依赖等信息。
一、步骤:
1、创建服务
打开命令行工具,输入:
C:\Documents and Settings\tiger>sc create dmadmin binPath= "C:\WINDOWS\system32\dmadmin.exe" type= own start= auto depend= PlugPlay/RpcSs/dmserver DisplayName= "Logical Disk Manager Administrative Service"
create --创建服务操作
dmadmin --服务名称
binPath --可执行程序或DLL,OCX路径
start --是否自动开始
depend --依赖的服务
DisplayName --现实名称
执行结果:
[SC] CreateService SUCCESS
表示成功。若没有SUCCESS字样,则表示失败。
2、删除服务
C:\Documents and Settings\tiger>sc delete dmadmin
[SC] DeleteService SUCCESS
3、注意
参数格式为:参数名称=【空格】参数
等号一定要加空格,等号前不要加空格。所有参数必须严格遵守此规定,否则不成功。
二、sc 使用参数参考
Creates a service entry in the registry and Service Database.
SYNTAX:
sc create [service name] [binPath= ] <option1> <option2>...
CREATE OPTIONS:
NOTE: The option name includes the equal sign.
type= <own|share|interact|kernel|filesys|rec>
(default = own)
start= <boot|system|auto|demand|disabled>
(default = demand)
error= <normal|severe|critical|ignore>
(default = normal)
binPath= <BinaryPathName>
group= <LoadOrderGroup>
tag= <yes|no>
depend= <Dependencies(separated by / (forward slash))>
obj= <AccountName|ObjectName>
(default = LocalSystem)
DisplayName= <display name>
password= <password>
如需要添加一个服务,至少需要知道服务名称,可执行程序,依赖等信息。
一、步骤:
1、创建服务
打开命令行工具,输入:
C:\Documents and Settings\tiger>sc create dmadmin binPath= "C:\WINDOWS\system32\dmadmin.exe" type= own start= auto depend= PlugPlay/RpcSs/dmserver DisplayName= "Logical Disk Manager Administrative Service"
create --创建服务操作
dmadmin --服务名称
binPath --可执行程序或DLL,OCX路径
start --是否自动开始
depend --依赖的服务
DisplayName --现实名称
执行结果:
[SC] CreateService SUCCESS
表示成功。若没有SUCCESS字样,则表示失败。
2、删除服务
C:\Documents and Settings\tiger>sc delete dmadmin
[SC] DeleteService SUCCESS
3、注意
参数格式为:参数名称=【空格】参数
等号一定要加空格,等号前不要加空格。所有参数必须严格遵守此规定,否则不成功。
二、sc 使用参数参考
Creates a service entry in the registry and Service Database.
SYNTAX:
sc create [service name] [binPath= ] <option1> <option2>...
CREATE OPTIONS:
NOTE: The option name includes the equal sign.
type= <own|share|interact|kernel|filesys|rec>
(default = own)
start= <boot|system|auto|demand|disabled>
(default = demand)
error= <normal|severe|critical|ignore>
(default = normal)
binPath= <BinaryPathName>
group= <LoadOrderGroup>
tag= <yes|no>
depend= <Dependencies(separated by / (forward slash))>
obj= <AccountName|ObjectName>
(default = LocalSystem)
DisplayName= <display name>
password= <password>
相关文章推荐
- 添加删除windows的系统服务
- 添加删除windows的系统服务
- instsrv.exe下载和使用方法(添加删除系统服务工具)
- 添加删除Windows系统服务
- 如何添加删除Windows中的系统服务
- Windows删除和添加两个MYSQL服务
- 使用目录服务和 Visual C# .NET 向本地系统添加用户
- centos系统添加/删除用户和用户组的例子
- 使用目录服务和 Visual C# .NET 向本地系统添加用户
- windows一段添加、删除注册表的bat代码,用于系统启动时打开某个程序
- 使用Java Service Wrapper 把Java程序作为Windows系统服务
- Winxp系统无法使用“添加或删除程序”怎么办 xp系统“添加或删除程序”无法使用的解决
- windows系统添加删除用户命令!
- 使用bcdedit删除多个Windows系统
- WIN XP 添加删除WINDOWS组件时,指定的系统光盘路径
- Windows系统下MySQL添加到系统服务方法(mysql解压版)
- Weblogic注册为Windows的系统服务项+删除服务项
- 使用WSW将Nginx创建为Windows系统服务
- windows系统添加服务命令
- Windows服务的手动添加和删除方法