Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 297829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:40:31+00:00 2026-05-12T06:40:31+00:00

I have what the UAC Development Guides refer to as a Administrative Choice Application.

  • 0

I have what the UAC Development Guides refer to as a “Administrative Choice Application.” If you’re familiar with what this is skip to the next section.

Background:

I want to let a “Standard” user have the ability to select/deselect a Run On Startup option in the preferences for my application.

Since my application is per machine (not per user), what needs to happen is it will either need to Delete or Copy a shortcut file into the Start Menu/Programs/Startup folder which will require administrative access to perform this operation.

So, what i’d like is for the “User Account Control credential prompt” to appear and that way if the user has an admin account also they can put in the credentials. This is apparently how applications are supposed to be designed to keep the user from having to switch to another account each time they need to do something administrative.

Excerpt from MSDN documentation:

An Administrative Choice Application

An Elevated Process or COM Object

The initial application launches without requiring elevation. Those items in the user interface that would require an administrative access token are decorated with a shield icon as identification. This decoration indicates to the user that using that feature will require administrator approval. When the application detects that one of these buttons has been selected, it has the following two choices.

  • The application launches a second program using ShellExecute() to perform the administrative task. This second program would be marked with a requestedExecutionLevel of requireAdministrator, thus causing the user to be prompted for approval. This second program would be running with a full administrative access token and would be able to perform the desired task.
    -OR-
  • The application launches a COM object using CreateElevatedComObject(). This API would launch the COM object with a full administrative access token following approval and this COM object would be able to perform the desired task.

I just need to copy a file… seems excessive to fork a new process using ShellExecute() and I don’t know enough about COM to know if I could use it to copy a file. I am hoping someone can post some code which provides a way to copy the file and ideally also explain how to decorate a MenuItem with the “sheild decorator”.

Notes:

I have looked at the UAC Demo provided by microsoft which is referenced in several StackOverflow posts such as (Request Windows Vista UAC elevation if path is protected?) on topics related to permissions. The code only has an example of the calling a separate process.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:40:32+00:00Added an answer on May 12, 2026 at 6:40 am

    I ended up going in a different direction. I had my installer create a startup shortcut in the All Users/Startup folder that passes an argument to the application “startup”.

    When the application started I would check for the existence of the arg[0].equals(“startup”) and then check if Settings1.Default.RunOnStartup == true.

    If both conditions were true I’d exit the application immediately. When the application is started without that argument (ie the Start Menu Program Group), the application loaded normally.

    The RunOnStartup setting is a user scoped setting so each user can change without effecting others.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have been having serious trouble getting an application we devlop running with UAC
I have an application which needs the UAC elevation. I have the code which
I have an application which needs to be able to create folders in UAC-protected
We have a C++ unmanaged application that appears to cause a UAC prompt. It
I'm seeking some guidance to make a self-updating application UAC compliant. I have an
I have an app modified to take into account the UAC in VISTA. So,
C++ projects have a linker option to embed manifest to require UAC elevation (/MANIFESTUAC:level)
Have just started converting an existing job tracking system into an ASP.NET MVC application.
We currently have an MSI that is created with WiX 3.5. The application is
I have a button that will launch a process that requires UAC elevation. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.