【问题标题】:Script to list the files of a folder and export it to a text document列出文件夹文件并将其导出到文本文档的脚本
【发布时间】:2013-05-03 21:55:14
【问题描述】:

我只是想知道是否有人知道一种方法可以获取某个位置(例如 C:\Users\Username)的所有文件夹、文件和子文件夹并将其导出到网络共享上的文本文档(如\server\share\document.txt)。

感谢您的帮助!

【问题讨论】:

    标签: windows file export directory


    【解决方案1】:

    从命令行(如果你需要这个,或者使用批处理文件):

    dir c:\users\username > \\server\share\document.txt
    

    这应该可以解决问题

    【讨论】:

      【解决方案2】:

      以下命令将显示指定目录和所有子目录中的所有文件,并将输出重定向到服务器共享上的文件。

      dir /s c:\Users\Username > \\server\share\document.txt
      

      如果要查看文件名中包含完整路径的文件,请添加 /b 选项。

      dir /s /b c:\Users\Username > \\server\share\document.txt
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-11-01
        • 1970-01-01
        • 1970-01-01
        • 2020-07-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多