Created
June 15, 2018 08:28
-
-
Save kaiware007/cc6298d531b557e166f82e43fb6a6b66 to your computer and use it in GitHub Desktop.
Unity Startup Batch 自動再起動、ログファイルを日時でリネーム、10日以上前のログファイル削除機能付き
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM "フォルダ名=appname" | |
for %%* in (.) do set appname=%%~nx* | |
if not exist LogBackup/ mkdir LogBackup | |
REM 10日以上前のログファイル削除 | |
forfiles /P LogBackup /D -10 /M "output_log_*.txt" /c "cmd /c del @file" | |
:begin | |
set hour=%time:~0,2% | |
set hour=%hour: =0% | |
set tailName=%date:~0,4%%date:~5,2%%date:~8,2%_%hour%%time:~3,2%%time:~6,2% | |
set logfile=LogBackup\output_log_%tailName%.txt | |
start /WAIT %appname%.exe -screen-width 1100 -screen-height 500 -logFile %logfile% | |
timeout /T 10 | |
Goto begin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment