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 7811635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:14:20+00:00 2026-06-02T04:14:20+00:00

Well I noticed that on Windows 7, sometimes even when you are an administrator,

  • 0

Well I noticed that on Windows 7, sometimes even when you are an administrator, you can’t do a lot of things, probably it’s some sort of bug, my application I check if an user is administrator before start the program because my program creates file in folders that are protected default like the root folder ( C: ), and if you aren’t an administrator on Windows 7, you can only create folders there.

So if I right click in my application and go “Run as Administrator”, it just works fine.
Is there a way to make my application run as administrator automatically? I would like to be able to make a line of code like: ActivateAdministrator(); and be available for the code completely, because I change attributes, create files with ifstream.

  • 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-06-02T04:14:22+00:00Added an answer on June 2, 2026 at 4:14 am

    You could add a manifest to your executable – http://msdn.microsoft.com/en-us/library/bb756929.aspx

    If the user is running on a system with the UAC switched on, and are not an administrator, a manifest which contains requestedExecutionLevel
    level="requireAdministrator"
    will produce a prompt for the Administrator password before your application can run with administrative privileges. (requiring administrator privileges means that an incorrect password or no password will stop it from running altogether)

    If they are an administrator with the UAC switched on, then that same manifest will cause a Yes/No prompt to ask whether your application should be granted administrative privileges.

    Of course, the real issue is that whatever your application is doing which requires administrative privileges needs to be examined.

    Most of the time the privilege is simply not required for normal user-level applications. This is an application design issue really – what is your application doing which requires admin privileges? is it really necessary? e.g. If you’re modifying files, then why are those files in a protected area on the file system instead of in the user’s profile space?

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

Sidebar

Related Questions

I noticed that in MySQL, both VARCHAR and TEXT offer variable-sized data. Well, VARCHAR
I am doing some GDI+ drawing in Visual C++ and noticed that my canvas
Basically we've noticed that on some computers setting the JVM option -Xmx (max heap
I noticed that I can add a reference not only to a DLL but
Well I'm doing some Java - C integration, and throught C library werid type
Well, to begin with, I'm using Visual Studio 2008 on a 32-bits Windows XP
I have a rather large chunk of code that breaks sometimes, as far as
So I was tasked at replacing some dummy code that our project requires for
Sorry if this question was asked already. I started studying C# and noticed that
I have started initially with VC++ 2008 Express. I've noticed that GCC becomes kind

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.