簡體   English   中英

從另一個批處理文件在路徑中使用空格調用Win Batch文件

[英]Calling Win Batch file with Whitespace in Path from another Batch file

在Windows 2012 Server計算機上,我想從包裝器批處理文件調用批處理文件。 被調用批處理文件的路徑包含一個空格,位於M:\\Programs\\Epic Games\\4.12\\Engine\\Build\\BatchFiles\\RunUAT.bat 所以我的包裝批處理文件如下所示:

@echo off
call "%1\%2\Engine\Build\BatchFiles\RunUAT.bat"

我從命令行這樣調用包裝器:

Wrapper.bat "M:\Programs\Epic Games" 4.12

但這會導致以下錯誤:

'""M:\Programs\Epic' is not recognized as an internal or external command,
operable program or batch file.

我嘗試了包裝中是否包含call ,但是結果是相同的。
有什么想法我在這里做錯了嗎?

請閱讀命令行參數(參數)call /?

如果啟用了命令擴展...

%~1 〜1-展開%1刪除所有引號( "

@echo off
SETLOCAL EnableExtensions
call "%~1\%~2\Engine\Build\BatchFiles\RunUAT.bat"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM