Computing.Net > Forums > Disk Operating System > Batch File Variables

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File Variables

Reply to Message Icon

Name: Smith
Date: November 13, 2003 at 14:53:45 Pacific
OS: XP Pro
CPU/Ram: AMD 1.4, 256MB
Comment:

I am trying to figure out how to program variables in batch files.

Any help on the following script would be helpful.

Thanks!!

:test
net send * Hello
set %A%=0
set %B%=%A%+1
If %B%= 50
GOTO 2
Else
Goto test
:2
pause


I am trying to send the message "hello" 50 times and then have the file pause.

Any help on the syntax would be great!



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: November 14, 2003 at 01:48:18 Pacific
Reply:

Your script is plagued by many mistakes; try the following

@Echo Off

Set Count=1
:LOOP
Net Send * Hello
Set /A Count=%Count%+1
If %Count% lss 50 GoTo :LOOP

Echo Message sent %Count% times
Set Count=
Pause


0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch File Variables

Batch File Variables www.computing.net/answers/dos/batch-file-variables/7151.html

Batch File Variables Troubles www.computing.net/answers/dos/batch-file-variables-troubles/14028.html

Batch file variables www.computing.net/answers/dos/batch-file-variables/14215.html