我需要得到FORFILES命令一些帮助:
forfiles /S /M "*.exe" /C "cmd /C echo @Path @ISDIR @Fdate @Ftime @Fsize" >> Output.txt
最后访问日期是不是一件FORFILES
产生。它可以在.bat文件脚本中使用PowerShell来完成。
powershell -NoProfile -Command ^
"Get-ChildItem -Recurse -File -Filter '*.exe' |" ^
"ForEach-Object {'""{0}""" {1} {2} {3}' -f @($_.FullName, $_.PSIsContainer, $_.LastAccessTime, $_.Length) }"
输出:
"C:\src\t\renexe\bar.exe" False 2018-02-16 02:19:51 6
"C:\src\t\renexe\baz.exe" False 2018-02-16 02:19:51 6
"C:\src\t\renexe\foo.exe" False 2018-02-16 02:19:51 6
您可以使用dir
命令助阵,这样的
forfiles /M *.xml /C "cmd /c dir /ta @file | findstr /R ^\d"
其中,为方便起见,findstr
过滤器。