详细批处理代码如下:
@echo off
title 各种服务开启、关闭程序
:allstart
cls
echo 1.Arcgis Server+Portal 服务开启、关闭
echo 2.VMware 服务开启、关闭-未启用
echo e.退出
set in=
set /p in=请输入:
if "%in%"=="1" goto arcserver
if "%in%"=="2" goto vmware
if "%in%"=="e" goto allclose
rem -----------------------------------------------------------
rem Arcgis Server+Portal 服务开启、关闭
:arcserver
echo 1.开启Arcgis Server+Portal 服务,2.关Arcgis Server+Portal 服务。3.设置为手动。
echo u.回到上层。e.退出。
set in=
set /p in=请输入:
if "%in%"=="1" goto arcserverstart
if "%in%"=="2" goto arcserverstop
if "%in%"=="3" goto arcserversd
if "%in%"=="u" goto allstart
if "%in%"=="e" goto allclose
:arcserverstart
echo "正在开启Arcgis Server+Portal 相关开机服务"
rem Arcgis Server
net start "ArcGIS Server"
rem Portal for ArcGIS
net start "Portal for ArcGIS"
goto arcserver
:arcserverstop
echo "正在关闭Arcgis Server+Portal 相关开机服务"
net stop "Portal for ArcGIS"
net stop "ArcGIS Server"
goto arcserver
:arcserversd
echo "切换Arcgis Server+Portal 开机启动服务为手动中"
sc config "ArcGIS Server" start= demand
sc config "Portal for ArcGIS" start= demand
echo 成功切换为手动模式
goto arcserver
rem -----------------------------------------------------------
rem VMware服务开启、关闭
:vmware
echo 1.开启vm服务,2.关闭vm服务。3.设置为手动
echo u.回到上层。e.退出。
set in=
set /p in=请输入:
if "%in%"=="1" goto vmstart
if "%in%"=="2" goto vmstop
if "%in%"=="3" goto vmsd
if "%in%"=="u" goto allstart
if "%in%"=="e" goto allclose
:vmstart
echo "正在启动VMware相关开机服务..."
rem net start ufad-ws60
net start VMAuthdService
net start VMnetDHCP
net start "VMware NAT Service"
net start VMUSBArbServicepause
echo 服务启动完毕!
goto vmware
:vmstop
echo "正在关闭VMware相关开机服务..."
rem net stop ufad-ws60
net stop VMAuthdService
net stop VMnetDHCP
net stop "VMware NAT Service"
net stop VMUSBArbService
echo 服务已关闭!
goto vmware
:vmsd
echo "切换VMware开机启动服务为手动中,请稍候..."
sc config VMAuthdService start= demand
sc config VMnetDHCP start= demand
sc config "VMware NAT Service" start= demand
sc config VMUSBArbService start= demand
echo 成功切换为手动模式!
goto vmware
:allclose
echo 按任意键退出
pause
exit