// Export/import IP settings on MS Windows with netsh

Every now an then, I need MS Windows for doing tests. I'm running different testing VMs and often have to deal with static IP settings on different LANs and VPNs. Therefore it is nice to know how to import and export IP settings without any GUI involved. I tested it only on XP/2k3 but it should also work on Vista/7.

  • Export: Configure your network settings as you like. Open a command prompt afterwards and use netsh to export the settings into a file:
    netsh -c interface ip dump > X:\network-foobar

    Repeat the task for every needed network.

  • Import: Use -f to load files like X:\network-foobar:
    netsh -f  X:\network-foobar

Now put the import command for different networks into separate batch files and name them properly to change the settings with simple double clicks. You might want to use runas for the netsh call because you need admin privileges to change IP settings.

I'm no native speaker (English)
Please let me know if you find any errors (I want to improve my English skills). Thank you!
Recent Comments
QR Code: URL of current page
QR Code: URL of current page start (generated for current page)