实例:
sc create resin2-80 binpath= "D:\resin2-80\bin\httpd.exe" displayname= "resin2-80"
sc create resin2-8088 binpath= "D:\resin2-8088\bin\httpd.exe" displayname= "resin2-8088"
D:\resin2-80\bin\httpd.exe
D:\resin2-8088\bin\httpd.exe
"D:\resin2-80\bin\httpd.exe" -service -java_home d:\Java\jdk1.6 -Xmx512m"
"D:\resin2-8088\bin\httpd.exe" -service -java_home d:\Java\jdk1.6 -Xmx512m"
"D:\resin2-8088\bin\httpd.exe" -service -java_home d:\Java\jdk1.6 -Xmx512m"
D:\mysql\bin>mysqld -remove
Service successfully removed.
MySql有好几种服务模式,具体情况看MySql的服务信息。如果换一种方式直接用sc也很简单
C:\Documents and Settings\zhangxudong>sc delete MySql
[SC] DeleteService 成功
另,偶再把最近学到的windows命令总结一下(加粗加亮部分):
C:\Documents and Settings\zhangxudong>tasklist
//类似于linux下的ps
Service successfully removed.
MySql有好几种服务模式,具体情况看MySql的服务信息。如果换一种方式直接用sc也很简单
C:\Documents and Settings\zhangxudong>sc delete MySql
[SC] DeleteService 成功
另,偶再把最近学到的windows命令总结一下(加粗加亮部分):
C:\Documents and Settings\zhangxudong>tasklist
//类似于linux下的ps
安装服务
sc create svnservice binpath= "d:\p\subversion\bin\svnserve.exe --service -r e:\repos" displayname= "svnservice" depend= Tcpip
sc config svnservice start= auto
sc create svnservice binpath= "d:\p\subversion\bin\svnserve.exe --service -r e:\repos" displayname= "svnservice" depend= Tcpip
sc config svnservice start= auto
删除服务
sc delete svnservice
sc delete svnservice
修改配置
sc config svnservice binpath= "d:\p\subversion\bin\svnserve.exe --service -r e:\repos" displayname= "svnservice" depend= Tcpip
sc config svnservice binpath= "d:\p\subversion\bin\svnserve.exe --service -r e:\repos" displayname= "svnservice" depend= Tcpip
设置为自启动
sc config svnservice start= auto
sc config svnservice start= auto
启动服务
net start svnservice
net start svnservice
如下:
===============================================
语法:sc create | delete | config 服务名 [参数]
主要参数列表:
start= demand|boot|system|auto|disabled|delayed-auto //启动类型
binPath= BinaryPathName //可执行文件路径
depend= 依存关系(以 / (斜杠) 分隔)
DisplayName= <显示名称> //屏幕显示名称
===============================================
语法:sc create | delete | config 服务名 [参数]
主要参数列表:
start= demand|boot|system|auto|disabled|delayed-auto //启动类型
binPath= BinaryPathName //可执行文件路径
depend= 依存关系(以 / (斜杠) 分隔)
DisplayName= <显示名称> //屏幕显示名称
作用依次是:新建、移除、重配置服务。
例如:重新配置服务mysql的执行路径的方法是:
sc config mysql binPath= "新路径"
================================================
sc config mysql binPath= "新路径"
================================================