Switch current network to "Home" mode from the command line

Is there a way to switch between Home, Public, and Work modes from the command line?


Solution 1:

It doesn't appear to be possible from the "regular" command line (unless the netsh command does what you need, see Nixphoe's answer), but if you on't mind using PowerShell for what ever it is you're doing then you can have a look at this blog post on MSDN.

Basically, Vista had a COM based api which you could use PowerShell to interact with. I assume it is still there in Win7. The blog post includes a sample script.

Solution 2:

Try using netsh. Here's some examples. You would want to dump your config to a file

netsh -c interface dump > c:'location1.txt

Then import it depending on where you're located.

netsh -f c:'location1.txt