0

我需要一些帮助来获取 forfiles 命令:

forfiles /S /M "*.exe" /C "cmd /C echo @Path @ISDIR @Fdate @Ftime @Fsize" >> Output.txt
4

2 回答 2

0

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
于 2018-09-05T12:57:00.657 回答
0

你可以使用dir命令来帮忙,像这样

forfiles /M *.xml /C "cmd /c dir /ta @file | findstr /R ^\d"  

findstr为了方便起见过滤器在哪里。

于 2018-09-05T16:35:40.140 回答