@echo off
set _logs=serverdata\logs\
if not exist %_logs% MKDIR %_logs%
chcp 65001
color 0F
cls
:restart
for /f "tokens=1-4 delims=/." %%a in ("%DATE%") do (set _date=%%c-%%b-%%a)
for /f "tokens=1-3 delims=,:" %%a in ("%TIME%") do (set _time=%%a%%b%%c)
server.exe -batchmode -datadir "serverdata/" -oxidedir "serverdata/oxide" -logfile "%_logs%output_%_date: =0%.%_time: =0%.txt"
timeout /T 5
for /f "tokens=1-4 delims=/." %%a in ("%DATE%") do (set _date=%%a-%%b-%%c)
for /f "tokens=1-2 delims=,:" %%a in ("%TIME%") do (set _time=%%a:%%b)
echo :::::::::::::::::::::::::::::::::::::::::::::::::
echo :: The server was restarted - %_date% %_time% ::
echo :::::::::::::::::::::::::::::::::::::::::::::::::
goto restart
日志无法创建。赢得2008 R2。试试这个:How to get current datetime on Windows command line, in a suitable format for using in a filename?
引用可能有问题吗?但它奏效了!
答案 0 :(得分:0)
UAC设置存在问题。 禁用它们解决了这个问题。