1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Batch File

Discussion in 'All Other Software' started by manomina, Oct 25, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. manomina

    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?
     
  2. WhitPhil

    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?
     
  3. manomina

    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?
     
  4. WhitPhil

    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
     
  5. Squashman

    Squashman 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
     
  6. manomina

    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!
     
  7. Sponsor

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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/643477

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice