Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
raspberry109
- Posts: 29
- Joined: 07 Jun 2017 23:40
#1
Post
by raspberry109 » 07 Sep 2017 06:21
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
2.bat
3.bat
etc...
Now pack all 500.bat in 1 big bat called ''Total.bat'
thxx!
-
Compo
- Posts: 600
- Joined: 21 Mar 2014 08:50
#2
Post
by Compo » 07 Sep 2017 06:57
Unless I'm missing something, what is wroing with…
Code: Select all
COPY "500line.txt" "Total.bat">NUL
-
aGerman
- Expert
- Posts: 4678
- Joined: 22 Jan 2010 18:01
- Location: Germany
#3
Post
by aGerman » 07 Sep 2017 10:11
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