daguilar01
is there any way that you can mke a bat file start like 5 .exe's

for example, if i had an inifite loop of exe's opening i would use

CODE
for /f "eol=; tokens=1" %%a in (numberoftimes.txt) do testprogram.exe %%a


this would run testprogram.exe with the first token in numberoftimes.txt as a paramater, but if i changed it to

CODE
for /f "eol=; tokens=1" %%a in (numberoftimes.txt) do
(
start testprogram.exe %%a
)

im asumming that this will constantly start testprogram.exe over and over again

so my question is, is there a way that you can set it so that it only opens 5 testprograms.exe at a time or something

thx in advance
daguilar01
kobilica
why not only:

QUOTE

test.exe
test.exe
test.exe
test.exe
test.exe


it will open 5 exe files.. or ? tongue.gif
coder
http://www.homestead.com/vbgames6/Batch.html
This tutorial seems to be mirrored quite a bit, hope it helps...
QUOTE
THE FOR LOOP

The syntax of the FOR LOOP is:

FOR %%PARAMETER IN(set) DO command

Most people change their mind about learning Batch Programming when they come
across the syntax of the For Command. I do agree that it does seem a bit weird,
but it is not as difficult as it appears to be. Let's analyze the various parts
of the For command. Before we do that look at the following example,

@ECHO OFF
CLS
FOR %%A IN (abc, def, xyz) DO ECHO %%A

Basically a FOR LOOP declares a variable (%%A) and assigns it different values
as it goes through the predefined set of values(abc, def, xyz) and each time
the variable is assigned a new value, the FOR loop performs a command.(ECHO %%A)

The %%A is the variable which is assigned different values as the loop goes
through the predefined set of values in the brackets. You can use any single
letter character after the two % sign except 0 through 9.We use two %'s as DOS
deletes each occurrence of a single % sign in a batch file program.

The IN(abc, def, xyz) is the list through which the FOR loop goes. The variable
%%a is assigned the various values within the brackets, as the loop moves. The
items in the set(The technical term for the set of values within the brackets)
can be separated with commas, colons or simply spaces.

For each item in the set(The IN Thing) the FOR loop performs whatever command is
given after the DO keyword.(In this example the loop will ECHO %%A)

So basically when we execute the above batch file, the output will be:

abc
def
xyz

The FOR loop becomes very powerful if used along with replaceable parameters. Take
the following batch file, for example,

@ECHO OFF
ECHO.
ECHO I am going to delete the following files:
ECHO %1 %2
ECHO.
ECHO Press Ctrl+C to Abort process
PAUSE
FOR %%a IN (%1 %2 ) DO DEL %%a
ECHO Killed Files. Mission Accomplished.

At execution time, the process would be something like:


C:\WINDOWS>batchfilename *.tmp *.bak

I am going to delete the following files:
*.tmp *.bak

Press Ctrl+C to Abort process
Press any key to continue . . .


daguilar01
QUOTE (kobilica @ Nov 28 2003, 06:46 PM)
why not only:

QUOTE

test.exe
test.exe
test.exe
test.exe
test.exe


it will open 5 exe files.. or ? tongue.gif

cause i want to read from a txt file and input the txt that is read from the txt file into the testprogram.exe as a parameter, but i want to read a new line for each instance of testprogram.exe

for example, if testprogram just took the paramater and then redisplayed it, i want each different instance of testprogram.exe to show differernt strings that were read from the txt file, thx for the reply coder, getting late right now, but will read that, hopefully it will help
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.