We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Script to run ipconfig commands

smoore6857
smoore6857 asked
on
Medium Priority
1,900 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.
Comment
Watch Question

EMEA Server Engineer
CERTIFIED EXPERT
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Pete LongTechnical Architect
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
MMMmm good call Luc, as theres nothing wrong with your syntax :)
Luc FrankenEMEA Server Engineer
CERTIFIED EXPERT

Commented:
I did the same thing yesterday with a tracert script... so I learn from my mistakes :)
Pete LongTechnical Architect
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
:)

Commented:
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

CERTIFIED EXPERT
Top Expert 2007

Commented:
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

Author

Commented:
LucF: That did the trick...I would have never thought of that!

Thanks!!
Luc FrankenEMEA Server Engineer
CERTIFIED EXPERT

Commented:
You're very welcome ;-)

LucF
Pete LongTechnical Architect
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
good call Luc
Luc FrankenEMEA Server Engineer
CERTIFIED EXPERT

Commented:
:)
CERTIFIED EXPERT
Top Expert 2007

Commented:
DOH! Now I catch on.  Good one Luc!
Luc FrankenEMEA Server Engineer
CERTIFIED EXPERT

Commented:
double :)
CERTIFIED EXPERT
Top Expert 2007

Commented:
I think I speak for Pete here...

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

LOL
Pete LongTechnical Architect
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
:)
Luc FrankenEMEA Server Engineer
CERTIFIED EXPERT

Commented:
ROTFL!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.