|
-
November 27th, 2002, 09:56 PM
#1
Junior Member
Variables in batch program.
Hello, folks...
I have a simple batch programming question. I know some people wrote tutorials about batch programming but they don't have this material.
How can I use varialbes in batch file. For example, I want to write a program such as if a server replies to ping, then outputs Alive, otherwise No. The first line is
ping x.x.x.x | find /C "Reply"
Since the ping command outputs "Reply from x.x.x.x" 4times if the server is alive, the find command above will generate a nonzero number. So, I was trying to put the number into a variable and use IF command, somthing like IF nonzero ..... echo Alive.
But how can I put the find result into a variable?
Did I make myself clear?
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|