【问题标题】:Get the file of same directory获取同目录的文件
【发布时间】:2014-01-13 06:22:19
【问题描述】:

我想问一个问题。

我想在 directory-of-file\program 中“调用”一个文件。

调用 *\program\test.bat

我该怎么做?

感谢您的帮助。

【问题讨论】:

    标签: cmd directory call


    【解决方案1】:

    %~dp0 为您提供运行的批处理文件所在的目录。

    所以应该这样做:

    call %~dp0\subdir\test.bat
    

    【讨论】:

    • 谢谢!这正是我想要做的完全!谢谢^.^
    • @user3186610 - 然后您应该通过单击答案左上角的复选标记 neqr 来接受答案。
    • 对不起。投票需要 15 声望。我还没收到。
    • 投票需要声誉 - 接受正确答案不需要。
    【解决方案2】:

    program 文件夹位于current batch file 所在的位置时,这将调用program\test.bat 文件。

    call "program\test.bat"
    

    【讨论】:

      猜你喜欢
      • 2016-07-20
      • 2010-11-08
      • 2021-12-04
      • 2014-01-03
      • 1970-01-01
      • 2017-11-13
      • 2012-04-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多