回复 1# joshatt - @echo off
- ::把批处理跟需处理的文件放在一起运行
- setlocal enabledelayedexpansion
- set olddate=%date:~,10%
- for /f "delims=" %%a in ('dir /a-d /b ^|find /i /v ".bat"') do (
- set "file=%%~dpa%%a"
- set "file=!file:\=\\!"
- echo !file!
- for /f "tokens=1* delims=. " %%b in ('wmic datafile where name^="!file!" get CreationDate ^|find "."') do set "creationdate=%%b"
- set "tmpdate=!creationdate:~,4!/!creationdate:~4,2!/!creationdate:~6,2!"
- set "tmptime=!creationdate:~8,2!:!creationdate:~10,2!:!creationdate:~12,2!"
- date !tmpdate!
- time !tmptime!
- copy /b "%%a"+,, /y
- )
- date %olddate%
- echo 请手动更新系统日期时间
- pause
复制代码
|