【问题标题】:fsutil command not working inside batchfsutil 命令在批处理中不起作用
【发布时间】:2014-04-07 08:36:19
【问题描述】:

我在 Windows 7 的 cmd 中使用以下命令来创建 40,000 个文件,但在我尝试将其编写为批处理文件时没有执行。我复制粘贴了与文件 40k.bat 相同的 cmd 以及其他命令。

For /L %i in (1,1,40000) do fsutil createnew 40kfile%i.txt 1048 

请告诉我为什么当我将 fsutil 作为批处理文件执行时它不起作用。或者请指出任何其他与 fsutil 一样快的替代方案。

【问题讨论】:

    标签: windows batch-file cmd


    【解决方案1】:

    当您在批处理文件中执行它时,将 %i 替换为 %%i

    【讨论】:

      【解决方案2】:

      你的代码应该更像这样:

      For /L %%i in (1,1,40000) do fsutil createnew 40kfile%%i.txt 1048
      

      你需要双倍的 %。看看这个http://www.robvanderwoude.com/escapechars.php 它应该告诉你%%

      我还在这里犯了一些信息What is the difference between % and %% in a cmd file?你可能会发现这很有用。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-06-07
        • 2014-02-09
        • 1970-01-01
        • 1970-01-01
        • 2014-01-06
        • 1970-01-01
        相关资源
        最近更新 更多