The batch commands are as follows:
@echo off&setlocal enabledelayedexpansion
set m=1
for /f "delims=" %%i in (s.txt) do (
set /a n+=1
if !n! leq 20 echo %%i>>s_!m!.txt
if !n! equ 20 set n=0&set /a m+=1
)
echo Done!
set /a dis=1
:11ss
for /f %%i in (s_%dis%.txt) do @ start %%i.bat
s.exe tcp 192.168.0.1 192.168.0.200 445 10 /save
set /a dis=%dis%+1
goto 11ss
I'd like to ask, after splitting s.txt into N files,
the script below runs the split files.
How can I make it automatically exit when it reaches the end and there are no more files???
For example, if s.txt gets split into 5 files,
how can I make the later script automatically exit after start s_5.txt???
How should I modify or rewrite it????
5 is not a fixed number...
Also,
while exiting, delete the files split out from s.txt?
@echo off&setlocal enabledelayedexpansion
set m=1
for /f "delims=" %%i in (s.txt) do (
set /a n+=1
if !n! leq 20 echo %%i>>s_!m!.txt
if !n! equ 20 set n=0&set /a m+=1
)
echo Done!
set /a dis=1
:11ss
for /f %%i in (s_%dis%.txt) do @ start %%i.bat
s.exe tcp 192.168.0.1 192.168.0.200 445 10 /save
set /a dis=%dis%+1
goto 11ss
I'd like to ask, after splitting s.txt into N files,
the script below runs the split files.
How can I make it automatically exit when it reaches the end and there are no more files???
For example, if s.txt gets split into 5 files,
how can I make the later script automatically exit after start s_5.txt???
How should I modify or rewrite it????
5 is not a fixed number...
Also,
while exiting, delete the files split out from s.txt?
