There's a difference between being logged in to an account that is part of the administrators group and running either (a) elevated or (b) as the builtin Administrator account.
Anytime you run as Administrator, you are always elevated -- by definition. So if you
run /user:administrator that window will be elevated when it opens, you WON'T get a UAC prompt and the
netsh command should run.
But because the builtin Administrator account always runs elevated and doesn't generate UAC prompts from
runas, it's a security risk, especially if it doesn't have a password. That's why Microsoft disables the Administrator account by default and requires that you enable it first:
In Windows® 7, the built-in administrator account is disabled by
default. In previous versions of Windows, an Administrator account was
automatically created during Out-of-Box-Experience (OOBE) with a blank
An Administrator account with a blank password is a security risk. To
better protect the system, the built-in Administrator account is
disabled by default in all clean installations and upgrades of Windows
Here's how you enable it. (You can open MMC by typing "mmc" in the "Run..." box in the Start menu.)
Change the properties of the Administrator account by using the Local
Users and Groups Microsoft Management Console (MMC).
- Open the MMC console and select Local Users and Groups.
- Right-click the Administrator account and select Properties.
- The Administrator Properties window appears.
- On the General tab, clear the Account is Disabled check box.
- Close the MMC console.
Also, be aware that
runas does NOT allow you to pass arguments to the program you run:
RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]
RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]
/smartcard [/user:<UserName>] program
RUNAS /trustlevel:<TrustLevel> program
If you'd like to run a command elevated under your own userid or if you'd like to pass arguments, you need a genuine
su (like this one, part of my own Hamilton C shell :) with an interlude marked in the application manifest as requiring elevation. If you do it that way, you will see a UAC prompt.