簡體   English   中英

如何在批處理文件中更改目錄?

[英]How to change directory in batch file?

我有一個批處理文件,如下所示

E:

cd E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\core

mvn clean install

cd E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\handset

mvn clean install

它將為核心運行mvn install命令

但不會為手機項目執行mvn install命令。

這是更改驅動器和文件夾的另一種方法。

如果mvn是批處理文件,則call命令可解決該問題。

cd /d "E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\core"
call mvn clean install

cd /d "cd E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\handset"
call mvn clean install

mvn必須在這兩個文件夾中都存在才能運行。

嘗試這樣:

pushd "E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\core"
mvn clean install
popd

pushd "cd E:\cvs-projects-command\customers\prd_mno_nfc_wallet\server\handset"
mvn clean install
popd

暫無
暫無

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

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