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-
Olaf BerliOwnerAsked:
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.

ITguy565Commented:
This is fairly easy:

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

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 : https://helpdeskgeek.com/networking/change-ip-address-and-dns-servers-using-the-command-prompt/
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
Alex GreenProject 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.
0
sarabandeCommented:
or edit 'hosts' file at windows\drivers\system32\etc  by adding text line

123.145.167.189 myalias

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

Sara
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

Alex GreenProject 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
0
Olaf BerliOwnerAuthor Commented:
Thanks!  Will make some .bat files with netsh :-)
0
Alex GreenProject Systems EngineerCommented:
You could use a hash group and a single script fella, give me some time and I can write one up
0
ITguy565Commented:
@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

0
Olaf BerliOwnerAuthor Commented:
Alex
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-
0
Olaf BerliOwnerAuthor Commented:
ITguy565
Thanks!
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
Windows OS

From novice to tech pro — start learning today.