Batch file for ipconfig
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 17

Thread: Batch file for ipconfig

  1. #1
    Registered User
    Join Date
    Dec 1998
    Location
    Thornton Heath, Surrey, London, England
    Posts
    136

    Batch file for ipconfig

    Hi,

    This may be really easy but i can't get it to work!

    Anyway, How do I create a batch file to run ipconfig?

    When i make one it either just loads a command prompt window and then sits there, or it scrolls the text rapidly nonstop?!

    Any help would be useful
    Thanks
    Nathan

  2. #2
    Registered User
    Join Date
    Aug 2000
    Location
    Middle of nowhere
    Posts
    473
    What are you trying to accomplish?

    You can create a batch file with ipconfig like this:

    ipconfig /all > ipconfig.txt

    What this does once it is run is instead of getting a scrolling dos prompt, you will actually get a txt file in the location of your choice of course with the output of ipconfig. I'm not sure that this is your desired outcome but I hope it helps.

  3. #3
    Tech-To-Tech Mod kato2274's Avatar
    Join Date
    Sep 2001
    Location
    Bentleyville, Pa
    Posts
    2,317
    hmm that's odd

    I'm on 98se here at work. I put the following text into a batch file I called test
    ipconfig/release 1
    ipconfig/renew 1
    (since we have a dial up adapter in there as well, 1 is adapter number of the NIC - for some reason the _all doesn't seem to work on 98)
    the batch file executed without a hitch and released and renewed an ip no problem.

    what OS are you on, and what's your batch file look like

  4. #4
    Registered User
    Join Date
    Dec 1998
    Location
    Thornton Heath, Surrey, London, England
    Posts
    136
    I am on both win2k or winxp.

    I thanks for the reply about sending the result to a text file. I hadn't thought of that.

    I simply want to use the ipconfig /all command to display my network settings in a "DOS" window.

    I want to have a batch file to do this because I change IP settings often in the process of testing things and I don't want to have to go Run then CMD then type in ipconfig /all.

    I want something I can put on my quick launch bar and click only once to display the results in a window.

    Thanks
    Nathan

  5. #5
    Registered User Archangel42069's Avatar
    Join Date
    Sep 2002
    Location
    Malebolge, 8th Level of Hell
    Posts
    607
    cut and paste this to your batch file. Works without a hitch, and nothing shows up but your ip configuration.


    @echo off
    ipconfig/all
    pause

    Later

  6. #6
    Registered User
    Join Date
    Dec 1998
    Location
    Thornton Heath, Surrey, London, England
    Posts
    136
    I am afraid that all that does is open up a window and then print ipconfig /all many many many many times!!

    sorry!

  7. #7
    Tech-To-Tech Mod kato2274's Avatar
    Join Date
    Sep 2001
    Location
    Bentleyville, Pa
    Posts
    2,317

    gotta be something in your config

    Originally posted by clarinathan
    I am afraid that all that does is open up a window and then print ipconfig /all many many many many times!!

    sorry!
    the script posted above works fine on about 6 win2k machines here in my schools lab

  8. #8
    Registered User Archangel42069's Avatar
    Join Date
    Sep 2002
    Location
    Malebolge, 8th Level of Hell
    Posts
    607
    Originally posted by clarinathan
    I am afraid that all that does is open up a window and then print ipconfig /all many many many many times!!

    sorry!
    Go to a command prompt and just type pause and tell me what it does.

  9. #9
    Registered User
    Join Date
    Dec 1998
    Location
    Thornton Heath, Surrey, London, England
    Posts
    136
    When I type pause at the command prompt it then says:

    please press any key to continue......

    Thanks for the help

  10. #10
    Registered User
    Join Date
    Dec 1998
    Location
    Thornton Heath, Surrey, London, England
    Posts
    136
    Another thought:
    Surely typing @echo off

    Means that whatever comes up on the screen will not be displayed?

  11. #11
    Registered User Archangel42069's Avatar
    Join Date
    Sep 2002
    Location
    Malebolge, 8th Level of Hell
    Posts
    607
    Originally posted by clarinathan
    Another thought:
    Surely typing @echo off

    Means that whatever comes up on the screen will not be displayed?
    @echo off suppresses commands only...it still allows the output to be displayed

  12. #12
    Registered User
    Join Date
    Dec 1998
    Location
    Thornton Heath, Surrey, London, England
    Posts
    136
    Ok my mistake.
    I have just tried this on a 2k server box.

    And, with the echo off command all that happens is the c: etc is not displayed. The results show up fine.

    Anyhow all the scripts mentioned so far work brilliantly on a 2k machine.

    Thanks for that.

    I guess that the question now is, why does this not work on winxp pro?

    Basically starting any command from a batch file has the effect of opening a dos box and then entering the command many times. Nothing seems to actually get executed.

    Also when trying some of the scripts posted here it often then opens hundreds of dos boxes which i can't then shut. The computer then runs out of memory and virtual memory!!!

    Any more ideas?

  13. #13
    Registered User Archangel42069's Avatar
    Join Date
    Sep 2002
    Location
    Malebolge, 8th Level of Hell
    Posts
    607
    Ok, I'm at home now...was @ work earlier, so I have now tested it on both 2K Pro AND XP Pro...no problems at all........not sure what to say. Will see what I can find though.

  14. #14
    Registered User
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    478
    try the following.
    cd\
    cd \windows\system32
    ipconfig /all
    pause

  15. #15
    Registered User
    Join Date
    Dec 1998
    Location
    Thornton Heath, Surrey, London, England
    Posts
    136
    Hi,

    Thanks for that last post.

    It works!!.

    Why does it work?!
    Is it something to do with putting in the specific path?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •