WinDrivers Computer Tech Support Forums

WinDrivers Computer Tech Support Forums (http://forums.windrivers.com/index.php)
-   Tech-To-Tech (http://forums.windrivers.com/forumdisplay.php?f=27)
-   -   Batch file for ipconfig (http://forums.windrivers.com/showthread.php?t=45187)

clarinathan October 16th, 2002 12:17 PM

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

CJK October 16th, 2002 12:27 PM

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.

kato2274 October 16th, 2002 12:33 PM

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

clarinathan October 16th, 2002 02:00 PM

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

Archangel42069 October 16th, 2002 03:48 PM

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

clarinathan October 16th, 2002 04:12 PM

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

sorry!

kato2274 October 16th, 2002 04:28 PM

gotta be something in your config
 
Quote:

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

Archangel42069 October 16th, 2002 05:03 PM

Quote:

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.

clarinathan October 17th, 2002 02:27 AM

When I type pause at the command prompt it then says:

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

Thanks for the help

clarinathan October 17th, 2002 02:32 AM

Another thought:
Surely typing @echo off

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

Archangel42069 October 17th, 2002 02:36 AM

Quote:

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

clarinathan October 17th, 2002 02:38 AM

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?

Archangel42069 October 17th, 2002 02:56 AM

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.

futuretech October 17th, 2002 03:39 PM

try the following.
cd\
cd \windows\system32
ipconfig /all
pause

clarinathan October 17th, 2002 04:23 PM

Hi,

Thanks for that last post.

It works!!.

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


All times are GMT -5. The time now is 08:12 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.