If you’re like me then perhaps you often don’t want your network interfaces to be enabled all the time. You might not have a hardware switch to turn off your wireless and going to Network and Sharing -> Change Adapter Settings right click enable / disable seems like such a chore especially when my default group policy means that you’re prompted for your password each time.
Well, the windows scripting host is your friend; here’s how to toggle your network interfaces
First of all name your network interfaces something clear; I’m going to use “VMWare-1” and “VMWare-2” because I like to disable the VMWare stuff until I’m actually using it, it used to cause a whole host of suspend/resume issues for me.
Then, you’ll need a script to toggle the interfaces on and off which is what this does, if it’s enabled, it’ll disable it, and vice versa. I’m going to call it vmnet-toggler.vbs (the .vbs will associate it with the wscript exe by default)
If you just run this, it won’t work of course, unless of course you’re an Administrator and UAC is disabled. Only those with weak minds disable UAC, so it won’t have worked.
What you need is a script to call this script with admin rights; that’s all you need to do, we’re looking for the admin script in the same directory as this script.
You can put a shortcut to the second script in the start menu or whatever, you will be asked to type in your password on the secure desktop prompt, but that’s only the once for all the network interfaces you want to disable.
If you’re super lazy then perhaps you can edit your group policy so that Administrators are “auto-elevated without prompting”, but I wouldn’t recommend that.