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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:52:42+00:00 2026-06-07T01:52:42+00:00

Imagine that some software in your Windows PC needs to be run in a

  • 0

Imagine that some software in your Windows PC needs to be run in a given time and it was supposed that it’s user would start it, but he forgot to do it. And that software was supposed to run as administrator (i.e. with administrator rights). So, in order to garantee that the given software will be open at that time, you put a watchdog than can perform what the user should have done.

This is not exactly my situation, but that’s what I need. It must work in C++ and I’m using Qt (though I think that will not make much difference).

I searched almost all files in MSDN about CreateProcess() and similar functions and saw some dozens of examples in the net, but till now I wasn’t able to do what I want (in fact, I wasn’t even capable of running the software, much less with the details).

It’s important to notice that the watchdog is supposed to just open the software as administrator and immediately “forget it”; it should have no control and the opened software must not be in anyway dependent on the watchdog (e.g. if the watchdog is closed, the opened software continue to run normally).

I’ld be glad if somebody helps.

Momergil

  • 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-07T01:52:44+00:00Added an answer on June 7, 2026 at 1:52 am

    Typically, if a program requires Administrator Rights to run, then a user with Administrator Rights is required to install it.

    This gives Administrator Rights to the program.

    Update: Based on your comment about trying to get another process to run another application with Admin Rights, you should look into the following code:

    using System.Security.Principal;
    
    public static void ProcessStart(string fileName, string arguments) {
      ProcessStartInfo startInfo = new ProcessStartInfo(fileName, arguments);
    #if !PocketPC
      try {
        WindowsIdentity id = WindowsIdentity.GetCurrent();
        WindowsPrincipal pal = new WindowsPrincipal(id);
        if (pal.IsInRole(WindowsBuiltInRole.Administrator)) {
          Process.Start(startInfo);
        }
      } catch (Exception e) {
        Console.WriteLine(e.Message);
      }
    #else
      Process.Start(startInfo);
    #endif
    }
    

    This code excludes Microsoft PocketPC devices and only executes if the person running the program is in the Administrator group.

    What you would need to do is initiate a WindowsIdentity for an account (on the PC you want to run your application on) that has Administrator rights and Impersonate that account to run your application.

    There is a working example of how to do this on CodeProject entitled User Impersonation in .NET that can give you a lot more information.

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

Sidebar

Related Questions

Imagine a client asked you to design a piece of software that would satisfy
Imagine you have an entity that has some relations with other entities and you
Imagine that HTML page is a game surface (see picture). User can have n
Imagine that your web application maintains a hit counter for one or multiple pages
I'm looking for a diagramming software that would produce good looking output. It doesn't
Our company is using some software that ONLY accepts input from an Imaging Device
Motivation Imagine a huffman compressed file that gets downloaded partially, like in P2P software,
Often I see some software and specially games that store setting in a text
I would like to ask you: Imagine that you have a site and there
Imagine that you need to write some Javascript that simply changes a set of

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.