Possible Duplicate:
Elevate a running program to administrator (Windows 7)
Situation:
I start a command prompt normally, without Administrator permissions, either accidentally by habit or intentionally because I don't plan on doing anything that requires elevated privleges.
After some work, it turns out I actually do need to run something from the command line with elevated privileges.
Question:
- How can I do this?
Parameters & Assumptions:
I want to do this without going outside of the existing CMD window. (I know all about Ctrl+Shift+Enter in the Start Menu, and "Run As" in context menus. I know
runas
at the command line might be an option, but this would force creation of a new CMD window. I want to elevate an existing, non-privileged CMD window.)I do not want to enable or create any additional accounts.
The built-in Administrator and Guest accounts (SIDs 500 & 501) are disabled, and either do not have passwords set or have very complex and human-unfriendly passwords configured. I want to keep them this way.
My account is a member of the Administrators group.
I'd rather do this with built-in tools only (Windows 7 Ultimate). Second preference would be Sysinternals or other Microsoft-provided add-ons. Third-party tools are a last resort option.
While
runas
orsudo
type functionality would probably be sufficient to solve this problem, I'd really like something that operates more likesu
- give me an elevated prompt from which I can run commands until I'm done with it.Ideally, I'd like this to be easily reversible - I want to be able to return to a non-elevated state within the same CMD window.
sudo
when I'm really looking forsu
.