Solved

Script to run ipconfig commands

Posted on 2004-03-24
15
1,866 Views
Last Modified: 2008-01-09
I wondering if anyone can give me the syntax for writing a batch file or simple executable to run:
ipconfig /release
ipconfig /renew

I tried creating a batch file containing exactly that, and what happens is the cmd windows show on the desktop and it seems to be in a loop in the release. It looks like it just keeps trying to run release over and over and the only way to stop it is to close the cms window. Not to mention IP is never released.

Please advise.
0
Comment
Question by:smoore6857
  • 6
  • 4
  • 3
  • +2
15 Comments
 
LVL 32

Accepted Solution

by:
Luc Franken earned 50 total points
Comment Utility
Hi smoore6857,

I'm just guessing you named the script "ipconfig.bat"
Just change the name.

Greetings,

LucF
0
 
LVL 57

Expert Comment

by:Pete Long
Comment Utility
MMMmm good call Luc, as theres nothing wrong with your syntax :)
0
 
LVL 32

Expert Comment

by:Luc Franken
Comment Utility
I did the same thing yesterday with a tracert script... so I learn from my mistakes :)
0
 
LVL 57

Expert Comment

by:Pete Long
Comment Utility
:)
0
 
LVL 2

Expert Comment

by:tomar31
Comment Utility
if you were to type in the command one at a time atthe dos prompt  does it still seem to be in a loop?

check your network connection to make sure that you are using DHCP

0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
Wouldn't think .bat would have anything to do with it.
If you're script is called IPRefresh.cmd or .bat - this should work.

Why don't you try redirecting the output?
ipconfig /release >> c:\results.txt

Let it run for a bit and then post results.txt
0
 

Author Comment

by:smoore6857
Comment Utility
LucF: That did the trick...I would have never thought of that!

Thanks!!
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 32

Expert Comment

by:Luc Franken
Comment Utility
You're very welcome ;-)

LucF
0
 
LVL 57

Expert Comment

by:Pete Long
Comment Utility
good call Luc
0
 
LVL 32

Expert Comment

by:Luc Franken
Comment Utility
:)
0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
DOH! Now I catch on.  Good one Luc!
0
 
LVL 32

Expert Comment

by:Luc Franken
Comment Utility
double :)
0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
I think I speak for Pete here...

(sirbounty & PeteLong in unison)
"we're not worthy" <echoing into the distance>

LOL
0
 
LVL 57

Expert Comment

by:Pete Long
Comment Utility
:)
0
 
LVL 32

Expert Comment

by:Luc Franken
Comment Utility
ROTFL!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

The DSL Parameters part of this article is valid and can be considered with any brand of internet router and modem (Dlink, 3com, Alcatel, Usrobotics, Parks), by accessing the configuration interface available by the manufacturer eg: http://10.1.1.1 …
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now