开发者

How to feed multiple commands (from a text file) through command prompt

开发者 https://www.devze.com 2023-03-05 06:25 出处:网络
I was wondering if its possible to execute a command e.g. start xxxxxxx where xxx开发者_开发问答xxxx is fed from a text file, so for example if the text file contained:

I was wondering if its possible to execute a command e.g. start xxxxxxx

where xxx开发者_开发问答xxxx is fed from a text file, so for example if the text file contained:

notepad
calc
putty

The following would be output in cmd:

start notepad
start calc
start putty

Can anyone let me know the easiest way to do this please


If your file is called cmds.lst, a batch file containing

for /f %%a in (cmds.lst) do start %%a

should do the trick

0

精彩评论

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