[英]Run 30 jar from batch and save the output result for each jar
嗨,我有一個問題,關於按批處理文件在同一文件夾中運行幾個jar文件。 我需要創建一個循環並讀取所有jar文件的名稱,然后全部運行它們,並為所有jar創建輸出。 像這樣的代碼:
cls
cd\
cd C:\java\
set PATH=%PATH%;C:\Program Files\Java\jdk1.8.0_20\bin;
cls
javac -jar "here come the name from the folder"
jarname < input1+"the name of the jar".txt > output1+"the name of the jar".txt
怎么樣:
for %%j in (*.jar) do (
java -jar "%%j" < "input%%~nj.txt" > "output%%~nj.txt"
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.