Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
i would like to make a loop in a .bat file
if thers a way i got one but theres to meny numbers 1- 255
ex;FOR %%1 IN (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17) do ping -n 1 192.168.1.%%1
this one works but i would have to type all 1-255 is there a why to make a counter 1-255? then loop it ?
thx -gorf

gorf,
please excuse my ignorance, and I don't mean to sound like an ass...but why are there so amny .bat postings?Do people really still use .bat files?
I'm really curious. And as far as looping, I think that you can loop in bat files, but I really don't remember the syntax. Might be helpful to do a goolge search on DOS or batch files.
Chi Happens

Yeah, actually, I think they do, Chi. Batch files are like the DOS equivelant of *nix scripting (at least in my mind). Do people still use scripts?
Of course, there's far fewer who use batch files becuase fewer know an extensive amount of DOS commands. Most of the people that would know how are nix users. ;)

Here is a reference fot the batch FOR command in Windows 2000/XP:
http://www.labmice.net/articles/batchcmds.htm

wow, i didn't know they still used batch files. I guess I never realized how much they are/were used. I have always written applications (DOS/Windows) to do stuff...I guess I never knew how much you could do in bat files.

Glad you got this working Gorf...
Just to put my two cents in about the "do people still use Batch files" comment...
Yes, I use them all the time to administer my Apache web servers and to interact with my C++ programs. I completely agree with Zeroguy... "Batch files are like the DOS equivelant of *nix scripting". I have always liked the command line, I suppose thats the reason I took a liking to the Gentoo Linux platform and the *nix shells and consoles... and the reason I still drop to DOS when I want to manipulate files or other tasks of the day.
Infinite Recursion

![]() |
Multiple connections to D...
|
Hide systray programatica...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |