set CurrentDate=%date:~0,10% set CurrentYear=%date:~0,4% set CurrentMonth=%date:~5,2% set CurrentDay=%date:~8,2% set CurrentTime=%time% set CurrentHour=%CurrentTime:~0,2% if /i %CurrentHour% LSS 10 (set CurrentHour=0%CurrentTime:~1,1%) set CurrentMinute=%time:~3,2% set CurrentSecond=%CurrentTime:~6,2% set CurrentDateTime=%CurrentYear%_%CurrentMonth%_%CurrentDay%_%CurrentHour%_%CurrentMinute%_%CurrentSecond% set log_file=c:\gminer-%CurrentDateTime%.log
log_file 里面装的就是文件名及路径,使用的时候这样用 %log_file%
例如 echo %log_file%