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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Luc FrankenEMEA Server EngineerCommented:
Hi smoore6857,

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

Greetings,

LucF
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Pete LongTechnical ConsultantCommented:
MMMmm good call Luc, as theres nothing wrong with your syntax :)
0
Luc FrankenEMEA Server EngineerCommented:
I did the same thing yesterday with a tracert script... so I learn from my mistakes :)
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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
Luc FrankenEMEA Server EngineerCommented:
You're very welcome ;-)

LucF
0
Pete LongTechnical ConsultantCommented:
good call Luc
0
Luc FrankenEMEA Server EngineerCommented:
:)
0
sirbountyCommented:
DOH! Now I catch on.  Good one Luc!
0
Luc FrankenEMEA 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
Luc FrankenEMEA Server EngineerCommented:
ROTFL!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Networking

From novice to tech pro — start learning today.