@echo off
chcp 65001
rem SET dt=%date%
rem SET dt=%dt:/=%
rem SET dt=%dt: =0%
set YEAR=%date:~0,4%
set MONTH=%date:~5,2%
set DAY=%date:~8,2%
set YMD=%YEAR%%MONTH%%DAY%
SET tm=%time:~0,8%
SET tm=%tm::=%
SET tm=%tm: =0%
set LOG_FOLDER=LOG
set LOG_FILE=%YMD%_%tm%_log.txt
cd /D %%~dp0
if not exist %LOG_FOLDER% (mkdir %LOG_FOLDER%)
echo %date:~0,10% %time:~0,8% 処理が正常に実行しました。>>.\%LOG_FOLDER%\%LOG_FILE%
for %%i in (*.bat) do (
echo %%i
echo %%i>>%LOG_FOLDER%\%LOG_FILE%
)
pause