I am a developer. I need to have a static IP address when I'm at my office, and would like to use my DHCP at home.

Making a reservation on the office's DHCP isn't possible (the router they have doesn't allow that).

I've looked up through Google to see if there is something that could suit my needs but haven't found any (Maybe it's because I don't know the name of the technology I'm looking for).

So my question is: Is there a way to automatically switch from a static address to a dynamic depending on the network?

  • If you're a developer, why don't you write your own command to detect it when Windows logs in?
    – Dave
    Aug 27, 2013 at 7:48

1 Answer 1


You must change IP manually or with a script. You can also write a program that changes IP depending on network. Below is a batch script for that purpose

netsh interface ip set address name="Local Area Connection" static 1
netsh interface ip set address "Local Area Connection" dhcp
  • All you need to do is have the script ran when at login time, easily achieved via task scheduler. I removed the "No" from your answer. + 1
    – Dave
    Aug 27, 2013 at 7:38
  • A startup script is good but not everyone shuts down/logs off their computer when going home, so maybe sometimes the IP doesn't change correctly, in that case maybe running the script manually is needed. But the best solution is that he writes his own IP changing program
    – phuclv
    Aug 27, 2013 at 8:43
  • But you can fire it at log on (or start up as you point out), even on a workstation un-lock! :)
    – Dave
    Aug 27, 2013 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.