开发者

FOR loop in batch file question

For the first time ever, im trying to write a simple batch file for-loop.

Here is my (pseudo) code.

FOR /f %%f IN ("alpha","bravo","charlie") DO  echo %%f

The intended output is for it to run the command for each word i开发者_开发技巧n the brackets (i.e. seperated by a comma).

alpha
bravo
charlie

It currently just prints alpha".


Remove /f so this is

FOR %%f IN ("alpha","bravo","charlie") DO  echo %%f

edited answer to remove the separated by spaces as I wasn't aware that you can use either space or commas to separate element of list.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜