簡體   English   中英

如何從批處理文件中調用帶有標志的批處理文件

[英]How to call a batch file with a flag from within a batch file

我有一個批處理腳本,需要調用其他需要標記才能成功運行的批處理腳本。

:adobe_install
    echo 1. Adobe Reader & echo 2. Adobe Flash Player & echo 3. Adobe Acrobat
    set /p choice="What would you like to install[1-3]: "
    if %choice%==1 call "%adobe_path%\adobe.bat"
    rem if %choice%==2 call "%cd%\scripts/Adobe/adobe.bat /f"
    rem if %choice%==3 call "%cd%\scripts/Adobe/adobe.bat /a"

adobe批處理腳本需要一個標志才能成功運行,必須給出以下標志之一: /a, 、、 /r/f

如何在批處理腳本中運行批處理腳本和標志?

我嘗試過的

if %choice%==1 call "%adobe_path%\adobe.bat"
# this works but only outputs the help menu of the script

if %choice%==1 call "%adobe_path%\adobe.bat /r"
# this will output "the syntax of the command is incorrect"

cd "%adobe_path%\scripts\Adobe"
if %choice%==1 call "\.adobe /r"
# same as above

if %choice%==1 start "%adobe_path%\adobe /r"
# launches another cmd and won't run the script
if %choice%==1 call "%adobe_path%\adobe.bat" /r

引用可執行文件(批處理文件)以在名稱中保留空格。 參數之間用空格(或逗號)分隔

暫無
暫無

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

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