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

7

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

Acorn

Posted 2011-07-15T10:22:32.213

Reputation: 678

Answers

2

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.

Windos

Posted 2011-07-15T10:22:32.213

Reputation: 10 080

1

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

Nixphoe

Posted 2011-07-15T10:22:32.213

Reputation: 566

2The dumped settings don't seem to have any mention of network type setting, am I missing something? – Acorn – 2011-07-15T11:47:27.647