English 中文(简体)
每3小时自动重新启用地雷射线服务器
原标题:Trying to auto restart minecraft server every 3 hours
问题回答

Welcome to stack overflow. As @Mofi mentioned in a comment, you can use TIMEOUT to create wait statement The script you might want would look something like this:

:start
echo loading server...
java -Xms3G -Xmx3G -jar minecraft_server.1.8.3.jar nogui
cls

REM I recommend NOT using TIMEOUT /T for the main wait, this way you can skip it and initiate a restart immediately 

TIMEOUT 10720

REM 3 hours minus 60 seconds to allow for 60 second restart notification

cls
echo server will restart
TIMEOUT /T 60
cls
goto :start


(鉴于你似乎有点新鲜,因此,欧研中心用于评论线)

To answer your question surrounding why the :choice section is a thing: It is initiated after the :start section, allowing you to either (Y) restart, or (N) stop the server





相关问题
complex batch replacement linux

I m trying to do some batch replacement for/with a fairly complex pattern So far I find the pattern as: find ( -name *.php -o -name *.html ) -exec grep -i -n hello {} + The string I want ...

How to split a string by spaces in a Windows batch file?

Suppose I have a string "AAA BBB CCC DDD EEE FFF". How can I split the string and retrieve the nth substring, in a batch file? The equivalent in C# would be "AAA BBB CCC DDD EEE FFF".Split()[n]

How to check which Operating System?

How can I check OS version in a batch file or through a vbs in an Windows 2k/2k3 environment ? You know ... Something like ... : "If winver Win2k then ... or if winver Win2k3 then ....

热门标签