batch-file - 使用 forfiles 获取上次访问日期
问题描述
我需要一些帮助来获取 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
推荐阅读
- sql - SQL Server 2014 相当于 GROUP_CONCAT()
- virtual-machine - 什么实际执行虚拟机的指令?
- .net - 如何使用 Ansible 安装 .NET Framework 4 SDK?
- ios - 无法在 Xcode 中登录:“无法与帮助应用程序通信。”
- python - 在python中将整数转换为2个字节
- flutter - 未安装 Flutter 和 Dart 插件
- c++ - std::vector 的 swap 和 shrink_to_fit() 的不同之处
- laravel - Laravel:配置文件中的动态变量(charlieuki 收据打印机)
- javascript - 如何用 useEffect 解决这个问题?错误:重新渲染过多。React 限制渲染次数以防止无限循环
- python - 使用 apache 和 mod wsgi 配置 django apscheduler