2

如何使用来自文本文件的参数启动程序?

批处理.bat

@textFile = "c:\Users\Arguments.txt";
start "" "C:\Users\coffee.cmd" --join test.js --compile @textFile 

参数.txt

test5.coffe 
test2.coffe
4

1 回答 1

2
@echo off
set arg_file=textFile
setlocal EnableDelayedExpansion
for /f "usebackq delims=" %%A in ("%arg_file%") do (
   set "argline=!argline! %%A"
) 
start "" "C:\Users\coffee.cmd" --join test.js --compile !argline!
endlocal
于 2013-05-23T11:27:40.770 回答