【问题标题】:Recursive Cmd Dir with Full Path for each line每行具有完整路径的递归 Cmd Dir
【发布时间】:2016-02-19 04:41:21
【问题描述】:

我想在 Windows 上创建一个递归 dir 命令,它允许我为每一行拥有每个文件的完整路径。

这是我想用每个文件的完整路径而不是文件名来改进的示例:
dir /S | findstr /R "^.*.xlsm$"

电流输出:

01/01/2012  00:01  1 023 456 fileName.xlsm
02/01/2015  01:02  2 345 678 fileName2.xlsm

预期输出:

01/01/2012  00:01  1 023 456 C:\Path\To\File\fileName.xlsm
02/01/2015  01:02  2 345 678 C:\Path\To\Other\File\fileName2.xlsm

【问题讨论】:

标签: windows recursion cmd path dir


【解决方案1】:

感谢 lunacodes,我可以通过它的解决方案改进我的答案。

这是我提供的对我的案例有所帮助的输入:
for /f "tokens=*" %a in ('dir /s /b') do echo %~za;%~ta;%~fa | findstr /R ".xlsm"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-13
    • 2018-01-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-27
    相关资源
    最近更新 更多