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

  • Home
  • SEARCH
  • 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 8402039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:57:05+00:00 2026-06-09T21:57:05+00:00

Programs under windows need administrator privilege must get user’s permission when they start. And

  • 0

Programs under windows need administrator privilege must get user’s permission when they start. And they can also run with administrator privilege by right click the EXE and select “Run as Administrator”. But, before the EXE start, a message box will show up. It’s really disgusting.

Now I want my application to run as the Administrator, and I don’t want the popup message box when user click the EXE file.

Now I wonder whether the AdjustTokenPrivileges function can help me achieve this.

Any one can help me?

  • 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-09T21:57:06+00:00Added an answer on June 9, 2026 at 9:57 pm

    You’re getting confused between rights and privileges. At least from the viewpoint of the Windows API, the two are entirely different (though they’re otherwise treated as synonymous a great deal of the time, at least when dealing with “what you can do on Windows”).

    What you’re really looking for is the ability to elevate rights. Short of some defect in the security model of the system, you shouldn’t be able to do this. To get administrative rights, the intent is that the code should have to run under an administrative account — either by the user initially logging in as an administrator, or else by them entering the credentials at run time as you’ve seen.

    Privileges (which are what AdjustTokenPrivileges actually manipulates) are things you have the right to do, but still aren’t allowed to do without specifically enabling that privilege. For example, let’s assume you start out logged in as an administrator. That gives you the right to adjust the system clock — but adjusting the system clock is something normal programs almost never have a reason to do, so they added an extra step, before you can do it — you need to enable the SE_SYSTEMTIME privilege before you can make use of that right.

    If you’re logged in under an account that doesn’t have the right to change the system time, you simply can’t do it. If you’re logged into an account that can change it, you have to enable the privilege first before you can do it.

    Bottom line: AdjustTokenPrivileges won’t accomplish what you’re trying to do.

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

Sidebar

Related Questions

I need to start a program from Windows Service. That program is a user
I'm writing a console program with Python under Windows. The user need to login
I need to have a makefile work under Windows and Cygwin. I having problems
I need some help regarding the extraction of eventlog data under Windows 7. What
I have a program that I need to run under *nix and windows. because
I'm writing a C program under Windows that should send an ENTER key to
I am going to program a GUI under windows (will be about 10,000 line
Under Windows, I have used a program called Dependency Walker to examine the libraries
What's the difference between a program developed in C++ under Windows and Linux? Why
I writing a PHP script program under Linux. In the script, I need call

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.