我的批处理脚本存在问题,该脚本配置为通过 Windows 任务计划程序每天每 6 小时运行一次。如果我手动运行计划或批处理,批处理就可以了,但当它自动运行时则不行。
这是批处理的样子:
@echo off
cd "C:\Program Files (x86)\Steam\SteamApps\common\Arma 2 CO\instance_11_Chernarus"
cscript /nologo "C:\Users\Administrator\Desktop\Batch Jobs\DayZ Epoch\timezone.vbs" > newfile 2>> error.log
del config.cfg
ren newfile config.cfg
ping 127.0.0.1 -n 3 >NUL
cd "C:\Program Files (x86)\Steam\SteamApps\common\Arma 2 CO"
start "arma2" /min "C:\Program Files (x86)\Steam\SteamApps\common\Arma 2 CO\Expansion\beta\arma2oaserver.exe" -port=2302 "-config=instance_11_Chernarus\config.cfg" "-cfg=instance_11_Chernarus\basic.cfg" "-profiles=instance_11_Chernarus" -name=instance_11_Chernarus "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;"
cd C:\Users\Administrator\Desktop\BEC\
start C:\Users\Administrator\Desktop\BEC\bec.exe -f Config.cfg
现在,批处理的工作是重新启动 Arma 2 OA 游戏服务器,当我手动运行脚本时,服务器会很好地重新启动,尽管当它自动运行时,服务器会向我抛出一个错误,显示“No entry Cfg.worlds " 并且此行中的某些内容未正确包含在服务器中,这是一个错误:
start "arma2" /min "C:\Program Files (x86)\Steam\SteamApps\common\Arma 2 CO\Expansion\beta\arma2oaserver.exe" -port=2302 "-config=instance_11_Chernarus\config.cfg" "-cfg=instance_11_Chernarus\basic.cfg" "-profiles=instance_11_Chernarus" -name=instance_11_Chernarus "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;"