跳转至

开启/关闭维护模式

您可以通过命令行将服务器设置为维护模式,也可以通过命令行退出维护模式。

输入以下命令将服务器设置为维护模式:

<Drive:>\<Program directory of the server>\VDogMasterService.exe /at:s /rd:<Drive:>\vdServerArchive /maintenance:on

输入以下命令退出维护模式:

<Drive:>\<Program directory of the server>\VDogMasterService.exe /at:s /rd:<Drive:>\vdServerArchive /maintenance:off

Info

包含空格的路径必须用引号括起来。

Info

在 Windows 7 和 Windows Server 2008 R2 下,命令行必须为以管理员身份运行

如果要使用批处理文件打开或关闭维护模式,可按以下方式查询服务器的状态:

  • if ERRORLEVEL 0 ECHO "Error message" >> Log file.txt 行动成功
  • if ERRORLEVEL 1 ECHO "Error message" >> Log file.txt 行动失败

示例

将服务器设置为维护模式

"C:\Program Files\vdogServer\VDogMasterService.exe" /at:s /rd:C:\vdServerArchive /maintenance:on

退出维护模式

"C:\Program Files\vdogServer\VDogMasterService.exe" /at:s /rd:C:\vdServerArchive /maintenance:off

使用 bat 文件将服务器设置为维护模式:

@echo off

REM Maintenance Mode on

"C:\Program Files\vdogServer\VDogMasterService.exe" /at:s /rd:C:\vdServerArchive /maintenance:on

if ERRORLEVEL 1 ECHO "Server was not properly put into Maintenance mode." >> d:\log.txt

if ERRORLEVEL 0 ECHO "Server was properly put into Maintenance mode." >> d:\log.txt

通过 bat 文件退出维护模式:

@echo off

REM Maintenance Mode off

"C:\Program Files\vdogServer\VDogMasterService.exe" /at:s /rd:C:\vdServerArchive /maintenance:off

if ERRORLEVEL 1 ECHO "Server was not properly taken out of Maintenance mode." >> d:\log.txt

if ERRORLEVEL 0 ECHO "Server was properly taken out of Maintenance mode." >> d:\log.txt

相关主题