• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Search | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

Loop in batch file

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More

View previous topic :: View next topic  
Author Message
loopers
Just Arrived
Just Arrived


Joined: 19 Nov 2002
Posts: 1


Offline

PostPosted: Tue Mar 18, 2003 2:52 pm    Post subject: Loop in batch file Reply with quote

How do we print out "Hello World" 3 times in batch file using loop? What is the syntax?
Back to top
View user's profile Send private message
ShaolinTiger
Forum Fanatic
Forum Fanatic


Joined: 18 Apr 2002
Posts: 16777215
Location: Kuala Lumpur, Malaysia

Offline

PostPosted: Tue Mar 18, 2003 2:57 pm    Post subject: Reply with quote

Code:
@ECHO OFF
ECHO HELLO WORLD
ECHO HELLO WORLD
ECHO HELLO WORLD
PAUSE
Back to top
View user's profile Send private message Visit poster's website
TheKingster
Link Spammer
Link Spammer


Joined: 03 May 2002
Posts: 0
Location: UK

Offline

PostPosted: Tue Mar 18, 2003 3:03 pm    Post subject: Reply with quote

That doesn't use a loop?
Back to top
View user's profile Send private message
ThePsyko
SF Mod
SF Mod


Joined: 17 Oct 2002
Posts: 16777178
Location: California

Offline

PostPosted: Tue Mar 18, 2003 4:51 pm    Post subject: Reply with quote

Some good ideas on DOS counting:
http://www.ericphelps.com/batch/samples/addition.txt

An example of subroutines in DOS:
http://www.ericphelps.com/batch/samples/subsdemo.bat.txt

DOS FAQs
http://home7.inet.tele.dk/batfiles/
Back to top
View user's profile Send private message Send e-mail
Snags
Just Arrived
Just Arrived


Joined: 30 Mar 2003
Posts: 0
Location: Terminal SYN

Offline

PostPosted: Wed Apr 02, 2003 8:13 am    Post subject: Reply with quote

Hmm...Uhmm, lol try this I guess...

@ECHO OFF
:loop1
ECHO HELLO WORLD
goto :loop2
:loop2
ECHO HELLO WORLD
goto :loop3
:loop3
ECHO HELLO WORLD

?LOL, I don't know , tell me if that's what you wanted.
Peace
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Area

Log in | Register