我需要一些帮助来获取 forfiles 命令:
forfiles /S /M "*.exe" /C "cmd /C echo @Path @ISDIR @Fdate @Ftime @Fsize" >> Output.txt
我需要一些帮助来获取 forfiles 命令:
forfiles /S /M "*.exe" /C "cmd /C echo @Path @ISDIR @Fdate @Ftime @Fsize" >> Output.txt
The last access date is not something that FORFILES
produces. It can be done in a .bat file script using PowerShell.
powershell -NoProfile -Command ^
"Get-ChildItem -Recurse -File -Filter '*.exe' |" ^
"ForEach-Object {'""{0}""" {1} {2} {3}' -f @($_.FullName, $_.PSIsContainer, $_.LastAccessTime, $_.Length) }"
Output:
"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
为了方便起见过滤器在哪里。