Link to home
Start Free TrialLog in
Avatar of Olaf Berli
Olaf BerliFlag for Norway

asked on

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-
ASKER CERTIFIED SOLUTION
Avatar of ITguy565
ITguy565
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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

123.145.167.189 myalias

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

Sara
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
Avatar of Olaf Berli

ASKER

Thanks!  Will make some .bat files with netsh :-)
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

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-
ITguy565
Thanks!