本帖最后由 pcl_test 于 2015-9-1 19:02 编辑
获取文件夹创建日期及时间的几种方法- @echo off
- ::dir,tc/ta/tw
- set "fd=C:\Windows"
- for /f "delims=" %%a in ("%fd%") do set "fp=%%~dpa"&set "fn=%%~nxa"
- for /f "tokens=1-3*" %%a in ('dir /ad /tc "%fp%"') do if "%fn%" equ "%%d" echo;%%a %%b
- pause
复制代码
- @echo off
- ::wmic,InstallDate/LastAccessed/LastModified
- set "fd=C:\Windows"
- for /f "tokens=2 delims==." %%a in ('wmic FSDIR "%fd:\=\\%" get InstallDate /value^|find "="') do echo;%%a
- pause
复制代码
- @echo off
- ::vbs,DateCreated/DateLastAccessed/DateLastModified
- set "fd=C:\Windows"
- >"%tmp%\tmp.vbs" echo;wscript.echo createobject("Scripting.FileSystemObject").getfolder("%fd%").DateCreated
- for /f "delims=" %%a in ('cscript /nologo "%tmp%\tmp.vbs"') do echo;%%a
- pause
复制代码
|