

I myself enabled it by opening Administrative Tools, Local Security Policy, then navigating to Local Policies\Security Options and changing the value of the Accounts: Administrative Account Status policy to Enabled, which is none of the three ways shown in the link.Īn even easier way to accomplish this: C:> net user Administrator /active:yes However, here is a great tutorial on how to enable it, in three different ways: Using runas this way requires the administrative account to be enabled, which is not the default on Windows 7 or Vista.

This isn't what I wanted, but it was easy enough to pass in the current path to my installer, and to reference it using an absolute path. Note that you must use Quotation marks, else the runas command will gobble up the switch option to cmd.Īlso note that the administrative shell (cmd.exe) starts up in the C:\Windows\System32 folder. In my case, this was runas /user:Administrator "cmd.exe /C %CD%\installer.cmd %CD%" runas /user:Administrator "cmdName parameters"

All you have to do is use the runas command to run your program as Administrator (with a caveat).
