Thursday, August 18, 2011

Set Windows Network Settings From The Command Line Using Net Shell (netsh.exe)


If you are changing network settings repeatedly on a test system it gets old having to point and click each time. Net Shell (netsh.exe) can be called as follows from the command line:

   netsh interface ipv4 set address name="Local Area Connection" dhcp HOST_IP
   SUBNETMASK GATEWAY_IP


For example:

   netsh interface ipv4 set address name="Local Area Connection" 10.0.0.2   
   255.255.255.0 10.0.0.1

Typing this over and over will get old as well so you can make a simple batch file called
ip.bat containing:

   netsh interface ipv4 set address name="Local Area Connection" %1 %2 %3 %4

Now you can type:

   ip [dhcp | static] HOST_IP SUBNETMASK GATEWAY_IP

For example:

   ip dhcp 10.0.0.2 255.255.255.0 10.0.0.1


Of course you can just create individual batch files for each test scenario.





11 comments:

  1. Company needs to be each part of daily business marketing and web design and also act as a good marketing campaign device once the period is appropriate.

    ReplyDelete
  2. They initially focused on the UX and redesigning the features and functionality. Since then, they’ve moved into the UI and the look and feel.
    branding companies

    ReplyDelete
  3. They integrate seamlessly with the internal team's terminology and approach.
    UI UX design agency

    ReplyDelete
  4. They were professional agency apps and able to work independently when needed

    ReplyDelete
  5. They have proven to be one of the most reliable technology partners.
    branding and marketing agency

    ReplyDelete
  6. Their team provided transformative design ideas and actualized their concepts with impeccable code.
    branding companies SF

    ReplyDelete
  7. I’m eager to find the valuable information and for me this is the right place to get the good stuff.
    website design studios

    ReplyDelete
  8. An unbelievable blog. This blog will indisputably be definitely recommended to my friends as well.
    best logo design company

    ReplyDelete
  9. Totally unique stuff is here really amazing!!!
    best UX agencies

    ReplyDelete