|
-
October 16th, 2002, 12:17 PM
#1
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
-
October 16th, 2002, 12:27 PM
#2
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.
-
October 16th, 2002, 12:33 PM
#3
Tech-To-Tech Mod
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
-
October 16th, 2002, 02:00 PM
#4
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
-
October 16th, 2002, 03:48 PM
#5
Registered User
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
-
October 16th, 2002, 04:12 PM
#6
I am afraid that all that does is open up a window and then print ipconfig /all many many many many times!!
sorry!
-
October 16th, 2002, 04:28 PM
#7
Tech-To-Tech Mod
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
-
October 16th, 2002, 05:03 PM
#8
Registered User
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.
-
October 17th, 2002, 02:27 AM
#9
When I type pause at the command prompt it then says:
please press any key to continue......
Thanks for the help
-
October 17th, 2002, 02:32 AM
#10
Another thought:
Surely typing @echo off
Means that whatever comes up on the screen will not be displayed?
-
October 17th, 2002, 02:36 AM
#11
Registered User
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
-
October 17th, 2002, 02:38 AM
#12
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?
-
October 17th, 2002, 02:56 AM
#13
Registered User
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.
-
October 17th, 2002, 03:39 PM
#14
try the following.
cd\
cd \windows\system32
ipconfig /all
pause
-
October 17th, 2002, 04:23 PM
#15
Hi,
Thanks for that last post.
It works!!.
Why does it work?!
Is it something to do with putting in the specific path?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks