17.5 Opening a Command Window with Admin Privileges Using MakeMeAdmin.cmd

Developing software as an Administrator, or running daily as one, is a serious security risk. Additionally, it may cause you to miss privilege-level-related issues in your software until late in the development cycle or, worse yet, after the software’s shipped.

However, if you always run as a regular user, you’re unable to do the occasional tasks that do require administrative privileges, such as working with the IIS management snap-in, setting object permissions, or starting/stopping services. You should do the bulk of your work in the basic user security context, but you can’t completely sacrifice productivity by forcing yourself to log into a new account each time you need to do an administrative task.

Aaron Margosis, author of PrivBar and a member of Microsoft’s .NET Security team, has come up with a great tool to help you solve this problem. MakeMeAdmin.cmd spawns a command prompt that runs under your normal user account, but in a completely new login session in which your account has been added to the local system’s Administrators group.

MakeMeAdmin.cmd at a Glance

Tool

MakeMeAdmin.cmd

Version covered

None given

Home page

http://blogs.msdn.com/aaron_margosis/archive/2004/07/24/193721.aspx

Power Tools page

http://www.windevpowertools.com/tools/99

Summary

Provides access to a command window with Admin privileges

License ...

Get Windows Developer Power Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.