我想创建一个启动mysql服务的bat
if mysql服务未启动{
if mysql服务类型非手动 {
设置mysql服务类型为手动
启动mysql服务
}else{
启动mysql服务
}
}else{
停止mysql服务
}
对照写了一个bat 但不成功,麻烦大家给予指正。。。谢谢
@echo off
if not sc qurey mysql | find /i "runing" {
if not sc config mysql start= demand {
sc config mysql start= demand
net start "mysql"
}else{
net start "mysql"
}
}else{
net stop "mysql"
}
if mysql服务未启动{
if mysql服务类型非手动 {
设置mysql服务类型为手动
启动mysql服务
}else{
启动mysql服务
}
}else{
停止mysql服务
}
对照写了一个bat 但不成功,麻烦大家给予指正。。。谢谢
@echo off
if not sc qurey mysql | find /i "runing" {
if not sc config mysql start= demand {
sc config mysql start= demand
net start "mysql"
}else{
net start "mysql"
}
}else{
net stop "mysql"
}
