Results 1 to 5 of 5

Thread: open a form with elevated privileges

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2018
    Posts
    26

    open a form with elevated privileges

    Good morning people!

    I have a project that has 2 forms. When I compile the executable I allow the end user to run my app without elevated privileges, so the app opens.

    It turns out that in FORM2 there are routes that only work if the user opens with elevated privileges, so I would like a routine that allows running Form2 without the user closing the app and running it with elevated privileges. Am I clear?

    Example: Form2.Show VBModal 'With Admin Privilegies

    Thank you!

  2. #2
    Junior Member Derp!'s Avatar
    Join Date
    Jan 2019
    Posts
    23

    Re: open a form with elevated privileges

    Quote Originally Posted by hennyere View Post
    Good morning people!

    I have a project that has 2 forms. When I compile the executable I allow the end user to run my app without elevated privileges, so the app opens.

    It turns out that in FORM2 there are routes that only work if the user opens with elevated privileges, so I would like a routine that allows running Form2 without the user closing the app and running it with elevated privileges. Am I clear?

    Example: Form2.Show VBModal 'With Admin Privilegies

    Thank you!
    Wouldn't it simply be easier to notify the user that they should run the program in admin mode?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2018
    Posts
    26

    Re: open a form with elevated privileges

    Quote Originally Posted by Derp! View Post
    Wouldn't it simply be easier to notify the user that they should run the program in admin mode?
    Thank you for your message!


    Sometimes we work with a scenario where there is limited access for users, so that a support team intervention is punctual. If you are working on a system, logging out of it to log in as Admin and then return to continue with your activities may not look good!

  4. #4
    PowerPoster
    Join Date
    Feb 2017
    Posts
    2,246

    Re: open a form with elevated privileges

    You basically have two ways:

    1) Run another instance of your program with elevated privileges.

    2) Adjust the privileges of the current running process.

    For the second option, perhaps this code could be useful (but that thread is about another thing).

    This second option would be better I think.

    For the first option, I made a sample project.
    Attached Files Attached Files

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Posts
    21,031

    Re: open a form with elevated privileges


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width