@echo off
title 计算机服务管理
:allstart
cls
echo 曾俊工作室
echo 1.SQL Server 2008 服务开启、关闭
echo 2.MySQL 服务开启、关闭
echo 3.Oracle 11g 服务开启、关闭
echo e.退出
set in=
set /p in=请输入:
if "%in%"=="1" goto sqlserver
if "%in%"=="2" goto mysql
if "%in%"=="3" goto oraclexe
if "%in%"=="e" goto allclose
rem SQL Server 2008服务开启、关闭
:sqlserver
echo 1.开启SQLServer服务,2.关SQLServer服务,3.设置为手动
echo u.回到上层,e.退出
set in=
set /p in=请输入:
if "%in%"=="1" goto sqlserverstart
if "%in%"=="2" goto sqlserverstop
if "%in%"=="3" goto sqlserversd
if "%in%"=="u" goto allstart
if "%in%"=="e" goto allclose
:sqlserverstart
echo "正在开启SQL Server相关开机服务"
rem SQL Server (MSSQLSERVER)
net start MSSQLSERVER
goto sqlserver
:sqlserverstop
echo "正在关闭SQL Server相关开机服务"
net stop MSSQLSERVER
goto sqlserver
:sqlserversd
echo "切换SQL Server开机启动服务为手动中"
sc config MSSQLSERVER start= demand
echo 成功切换为手动模式
goto sqlserver
rem MySQL服务开启、关闭
:mysql
echo 1.开启mysql服务,2.关闭mysql服务,3.设置为手动
echo u.回到上层,e.退出
set in=
set /p in=请输入:
if "%in%"=="1" goto mysqlstart
if "%in%"=="2" goto mysqlstop
if "%in%"=="3" goto mysqlsd
if "%in%"=="u" goto allstart
if "%in%"=="e" goto allclose
:mysqlstart
echo "正在启动MySQL相关开机服务..."
net start MySQL
echo 服务启动完毕!
goto mysql
:mysqlstop
echo "正在关闭MySQL相关开机服务..."
net stop MySQL
echo 服务已关闭!
goto mysql
:mysqlsd
echo "切换MySQL开机启动服务为手动中,请稍候..."
sc config MySQL start= demand
echo 成功切换为手动模式!
goto mysql
rem Oracle 11g 服务开启、关闭
:oraclexe
echo 1.开启oracle11g必要服务,2.关闭oracle11g必要服务,3.设置为手动
echo u.回到上层,e.退出。
set in=
set /p in=请输入:
if "%in%"=="1" goto oraclexestart
if "%in%"=="2" goto oraclexestop
if "%in%"=="3" goto oraclexesd
if "%in%"=="u" goto allstart
if "%in%"=="e" goto allclose1
:oraclexestart
echo "正在启动oracle 11g 必要服务..."
net start OracleOraDb11g_home1TNSListener
net start OracleServiceORCL
echo 服务启动完毕!
goto oraclexe
:oraclexestop
echo "正在关闭oracle xe相关开机服务..."
net stop OracleOraDb11g_home1TNSListener
net stop OracleServiceORCL
echo 服务已关闭!
goto oraclexe
:oraclexesd
echo "切换oracle xe开机启动服务为手动中,请稍候..."
sc config OracleOraDb11g_home1TNSListener start= demand
sc config OracleServiceORCL start= demand
echo 成功切换为手动模式!
goto oraclexe
:allclose
echo 按任意键退出
pause
exit