net stop nginx taskkill /im nginx.exe /f cd E:nginx e: set NO=%Date:~0,4%%Date:~5,2%%Date:~8,2% set t=%Time% if "%t:~0,1%" ==" " ( set t=0%t:~1% ) set NO=%Date:~0,4%%Date:~5,2%%Date:~8,2%%t:~0,2%%t:~3,2%%t:~6,2% move logsaccess.log bakaccess_%no%.log move logserror.log bakerror_%no%.log copy nul logsaccess.log copy nul logserror.log net start nginx pause