- @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 LastModified ^|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
复制代码 我用的是 LastModified,这个,但是把创建时间改成了 访问时间,这是怎么回事呢,我想把创建时间改成修改时间的,这是哪里的问题呢 |