My problem was I did not want to always “Run As…” all my important admin programs and mmc snap-ins all day because i didnt log on as an admin. It simply took up alot of my time and it frustrated me. What i really needed was a way to automatically (and securely) load all my administrative programs without having to enter any user names or passwords. Well i have a solution for anyone that had the same pain as i did.
The solution started off with the Free Elevation PowerToy found here where i used the elevation files in their original way, however i altered the original registry keys that go in the context menus along with the elevate.vbs to cater for certain anomalies.
A couple of the problems i came across were:
- MSC shortcuts that started with the %systemroot%\System32\mmc.exe and had parameters trailing the msc file the original script would fail (eg. %SystemRoot%\system32\mmc.exe %SystemRoot%\system32\dnsmgmt.msc /s)
- EXE programs that could not load when provided a parameter value of “” (eg. regedit.exe)
How it works?
- Right click on an EXE or an MSC file and click “Run as %username%” where %username% is the name you specified during install of the script
- That runs a command similar to runas.exe /savecred /noprofile /user:domain\user “elevate.cmd command parameter”
- A command prompt will either a. prompt for that user names password or b. load the saved credentials and continue processing.
- That executes elevate.cmd which collects the original command along with any parameters and parses it to elevate.vbs on Windows Vista/7. For windows XP is simply uses RUNAS (added functionality based on request).
- This then grabs the parameters and loads the application in elevated mode
To install this little add-on you need to do the following:
- Download the zip file on this page and extract it
- Run install.bat.
- For Windows XP you must be logged on as an Administrator
- For Windows 7 you need to run a CMD as Administrator, then navigate to the source directory and run install.bat from there (otherwise it will try and copy the contents of the Windows\System32 directory to the %temp% folder)
- Follow the prompts to install the software.
Open the ElevateAsMe.inf file and scroll to the bottom, change the user name and the domain name to correspond to your network
Install the ElevateAsMe.inf by right clicking and selecting Install. Note you can only install one version of this script because some naming in the registry conflicts. Part of it cannot be fixed based on how Windows uses elevation.
You can remove the software through Add/Remove programs. A manual removal is easy by following the details in the ElevateAsMe.inf file.
Please comment if any part of the script does not work, or fails with certain applications. I would be happy to try and resolve them so we can all benefit from it.
ElevateAsMe V2.2.0 – Recently Updated to support Windows XP and now has an install.bat for easy installation