Page 1 of 1

how to create 500 batch file?and to run at the same time but separately?

Posted: 07 Sep 2017 06:21
by raspberry109
i have a text file wich contains 500 lines,e.g..:

Code: Select all

clip.py -w s 12.690.89909
clip.py -w s 4654.87978
clip.py -w s 12690.7987
clip.py -w s 4654.890


How to create a .bat file for each line , separately

Output:

1.bat

Code: Select all

clip.py -w s 12.690.89909

2.bat

Code: Select all

clip.py -w s 4654.87978

3.bat

Code: Select all

clip.py -w s 12690.7987

etc...

Now pack all 500.bat in 1 big bat called ''Total.bat'
thxx!

Re: how to create 500 batch file?and to run at the same time but separately?

Posted: 07 Sep 2017 06:57
by Compo
Unless I'm missing something, what is wroing with…

Code: Select all

COPY "500line.txt" "Total.bat">NUL

Re: how to create 500 batch file?and to run at the same time but separately?

Posted: 07 Sep 2017 10:11
by aGerman
raspberry109 wrote:run at the same time but separately

The START command is able to run processes asynchronously. Assuming all of your 500 command lines are in "list.txt" ...

Code: Select all

@echo off
for /f "usebackq delims=" %%i in ("list.txt") do start cmd /c "%%i"

Of course it will open 500 cmd windows that way. They will close automatically if the python interpreter quits.

Steffen