Script to run ipconfig commands

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.
smoore6857Asked:
Who is Participating?
 
LucFConnect With a Mentor EMEA Server EngineerCommented:
Hi smoore6857,

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

Greetings,

LucF
0
 
Pete LongTechnical ConsultantCommented:
MMMmm good call Luc, as theres nothing wrong with your syntax :)
0
 
LucFEMEA Server EngineerCommented:
I did the same thing yesterday with a tracert script... so I learn from my mistakes :)
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
Pete LongTechnical ConsultantCommented:
:)
0
 
tomar31Commented:
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
 
sirbountyCommented:
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
 
smoore6857Author Commented:
LucF: That did the trick...I would have never thought of that!

Thanks!!
0
 
LucFEMEA Server EngineerCommented:
You're very welcome ;-)

LucF
0
 
Pete LongTechnical ConsultantCommented:
good call Luc
0
 
LucFEMEA Server EngineerCommented:
:)
0
 
sirbountyCommented:
DOH! Now I catch on.  Good one Luc!
0
 
LucFEMEA Server EngineerCommented:
double :)
0
 
sirbountyCommented:
I think I speak for Pete here...

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

LOL
0
 
Pete LongTechnical ConsultantCommented:
:)
0
 
LucFEMEA Server EngineerCommented:
ROTFL!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.