Batch File

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

manomina

Thread Starter
Joined
Jul 6, 2006
Messages
542
:confused: I was tring to make a SIMPLE batch file that would read multiple arguements, the batch file is called NEW.BAT. This is what I have:

ping <machine name>%1 %2 %3 %4 %5 %6 %7 %8 %9

The %1 represents the last 3 digits that I enter so I can type NEW JKL and it will find that machine. It will work if I only have one arguement, but I am testing to see if there are 12 machines at a time. What am I doing wrong? I have tried just doing 9 arguments but anything over one I get a bad parameter. Any suggestions?
 

WhitPhil

Gone but never forgotten
Trusted Advisor
Joined
Oct 4, 2000
Messages
8,684
It you were not using the batch file, can you post back the commands you are trying to run?
 

manomina

Thread Starter
Joined
Jul 6, 2006
Messages
542
Let me see if I have this straight. I can type:

ping computer001

it comes back fine. So I put in the arguements (batch file called NEW) and try to type:

new 001 002 003 to check on those computers and it's a bad parameter. Can this be done?
 

WhitPhil

Gone but never forgotten
Trusted Advisor
Joined
Oct 4, 2000
Messages
8,684
The syntax of the Ping command is (excluding all the options) is
Ping {name}

So, when you pass in multiple parameters, it results in something like
Ping Machine001 002 003 004
and the 002 003 004 are invalid parameters.

You would need to do
Ping Machine%1
Ping Machine%2
Ping Machine%3
.....etc

to fire up a Ping for each machine
 

Squashman

Retired Trusted Advisor
Joined
Apr 4, 2003
Messages
19,786
We've done this batch file on the forums already. Just gotta find the thread.

But I personally would just use Super Scan. With SuperScan it will ping your entire subnet rather quickly and tell you what comptuers are on your network.
http://www.snapfiles.com/get/superscan.html
 

manomina

Thread Starter
Joined
Jul 6, 2006
Messages
542
That does work,

Ping Machine%1
Ping Machine%2
Ping Machine%3

I didn't think it would produce the results. I will try out the Super Scan.
Thanks!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top