batch file idea help

Discussion in 'Computing and Networks' started by electronis whiz, Feb 14, 2012.

  1. electronis whiz

    Thread Starter Well-Known Member

    Jul 29, 2010
    519
    27
    I came up with an idea the other day. Because I know somebody that just knows enough about computers to be dangerous. sometimes they have a internet or related problem (at least they think because of some network program for the modem has different color lights on the message pane of the windows taskbar. and sometimes i may bring up a ping just to verify. and it is usually ok. I was thinking it would be nice to make a batch file and put it on the desktop. then if they think theirs an issue they can just click the file and see the output and close it. I could probably do this pretty easily. However I would thought maybe there was a way it could bring up some dialog box with a message such as [test connection to] then have a combo box where they could select or enter the site or ip to ping. Then pass that variable back to the batch file where it would run then either shows a message in the shell or in another dialog box of the results. I’m wondering 1. Is this even possible or would this be like some java or other programming language? 2. Is it is how do I go about making the it display the message then accept a value in then run it?
     
  2. magnet18

    Senior Member

    Dec 22, 2010
    1,232
    124
    Code ( (Unknown Language)):
    1.  
    2.  
    3. set PING=
    4. set /P PING=ping destination (ip address or web address; ex. 127.0.0.1 or google.com): %=%
    5. Ping %PING%
    6. pause
    7.  
    like this?
    (and whatever you do, DONT save it as ping.bat, save it as autoping.bat or something)
     
  3. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,795
    830
    Dialog boxes in a batch file would require programming in a language such as Java, VB, etc... However, you could set a default host, prompt for a test host name (and use the default if nothing was entered, perform the ping and pause until the user responds. You could even test to see if the ping was successful.

    Look for the batch commands and their options: echo, set, if, pause...
     
  4. bertus

    Administrator

    Apr 5, 2008
    15,645
    2,344
  5. electronis whiz

    Thread Starter Well-Known Member

    Jul 29, 2010
    519
    27
    ok thanks that is kind of what i thought. sorry for the slow responce hvent had a chance to get on here.
     
Loading...