Shortcuts to set IP addresses in Win 10

I bring my (Windows 10 Pro) laptop around to do support in a few different networks - some with DHCP and some where a fixed IP-address is needed. Have tried to find a way to make shortcuts to set the fixed addresses (or set the network adapter back to dhcp), but haven't found a way to do it. Thinking of commands in a batch-file. Any suggestions?

Olaf BerliOwnerAsked:
Who is Participating?
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.

This is fairly easy:

netsh interface ip set address name="Local Area Connection" static

Open in new window

Find the Adapter name and modify it and then change the above to the settings you need. Save as .bat file and you are good to go..

reference :

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
AlexProject Systems EngineerCommented:
You can do it in powershell as well, with that you could query the domain and then set the ip from that variable.
or edit 'hosts' file at windows\drivers\system32\etc  by adding text line myalias

note, you may need opening notepad 'by administrator' to be able to store the settings.

OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

AlexProject Systems EngineerCommented:
That wouldn't help with DNS nor would it facilitate the setting of the IP. That won't achieve anything pertaining to the IP address change at all unfortunately
Olaf BerliOwnerAuthor Commented:
Thanks!  Will make some .bat files with netsh :-)
AlexProject Systems EngineerCommented:
You could use a hash group and a single script fella, give me some time and I can write one up
@Olaf Berli

I just realized I only answered part of the question :

Switch back to DHCP :
netsh interface ip set address "Local Area Connection" dhcp

Open in new window

Olaf BerliOwnerAuthor Commented:
OK. Don't know what a hash group is, but would be nice to know.
On the other hand - I'm quite familiar with batch files, so the mentioned commands above is easy for me to implement.

Olaf BerliOwnerAuthor Commented:
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
Windows OS

From novice to tech pro — start learning today.