Click here to Skip to main content
15,885,914 members
Articles / Security

Elevating During Runtime

Rate me:
Please Sign up or sign in to vote.
4.93/5 (65 votes)
15 Feb 2013CPOL3 min read 146.2K   5.6K   107  
How can an application elevate itself to gain "Admin" rights during runtime
This article explains how to elevate an application during runtime. If your application would not require Admin rights except for certain occasions, you might prefer building your application with no specific requirement to be run in Admin mode, but when it needs to make a Registry change, only then, it will elevate itself to Admin mode. This article explains how that is done.
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="ElevateUAC">
</Property><Property Name="Solution File" Value="C:\Users\M\Downloads\HowToElevate_By_Michael_Haephrati\ElevateUAC.sln">
</Property><Property Name="Date" Value="יום שישי 27 ינואר 2012">
</Property><Property Name="Time" Value="22:24:59">
</Property></Properties><Event ErrorLevel="0" Project="ElevateUAC" Source="ElevateUAC.vcproj" Description="Converting project file 'C:\Users\M\Downloads\HowToElevate_By_Michael_Haephrati\ElevateUAC.vcproj'.">
</Event><Event ErrorLevel="1" Project="ElevateUAC" Source="ElevateUAC.vcproj" Description="This application has been updated to include settings related to the User Account Control (UAC) feature of Windows Vista. By default, when run on Windows Vista with UAC enabled, this application is marked to run with the same privileges as the process that launched it. This marking also disables the application from running with virtualization. You can change UAC related settings from the Property Pages of the project.">
</Event><Event ErrorLevel="1" Project="ElevateUAC" Source="ElevateUAC.vcproj" Description="VCWebServiceProxyGeneratorTool is no longer supported. The tool has been removed from your project settings.">
</Event><Event ErrorLevel="1" Project="ElevateUAC" Source="ElevateUAC.vcproj" Description="Attribute 'Detect64BitPortabilityProblems' of 'VCCLCompilerTool' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="0" Project="ElevateUAC" Source="ElevateUAC.vcproj" Description="Web deployment to the local IIS server is no longer supported. The Web Deployment build tool has been removed from your project settings.">
</Event><Event ErrorLevel="1" Project="ElevateUAC" Source="ElevateUAC.vcproj" Description="Attribute 'Detect64BitPortabilityProblems' of 'VCCLCompilerTool' is not supported in this version and has been removed during conversion.">
</Event><Event ErrorLevel="0" Project="ElevateUAC" Source="ElevateUAC.vcproj" Description="Done converting to new project file 'C:\Users\M\Downloads\HowToElevate_By_Michael_Haephrati\ElevateUAC.vcxproj'.">
</Event><Event ErrorLevel="3" Project="ElevateUAC" Source="ElevateUAC.vcproj" Description="Converted">
</Event></UpgradeLog>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO Secured Globe, Inc.
United States United States
Michael Haephrati is a music composer, an inventor and an expert specializes in software development and information security, who has built a unique perspective which combines technology and the end user experience. He is the author of a the book Learning C++ , which teaches C++ 20, and was published in August 2022.

He is the CEO of Secured Globe, Inc., and also active at Stack Overflow.

Read our Corporate blog or read my Personal blog.





Comments and Discussions