Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. open an app as admin using QProcess

open an app as admin using QProcess

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 5.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • AmrCoderA Offline
    AmrCoderA Offline
    AmrCoder
    wrote on last edited by AmrCoder
    #1

    I have script .bat file i want to use QPorcess to run it or whatever to make this app run but i want it to run as an admin like i open it manually i right click it and select run as administrator how can i do this? because the script not execute and do it's job until it run as administrator.
    as i made alot of search but all i found is make the qt app itself run as admin
    Thanks in advance

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      There are many way to ask for escalated privileges but it often its just easier to reuse
      some solution , like
      https://sites.google.com/site/eneerge/scripts/batchgotadmin
      https://stackoverflow.com/questions/1894967/how-to-request-administrator-access-inside-a-batch-file
      http://www.soft.tahionic.com/download-run as admin console command/index.html

      1 Reply Last reply
      3
      • AmrCoderA Offline
        AmrCoderA Offline
        AmrCoder
        wrote on last edited by
        #3

        @mrjj Thank you very much i choose the third solution which is RunAdmin.exe and use it in with Qprocess and it working fine Thanks again

        1 Reply Last reply
        2
        • M Offline
          M Offline
          m3g1dd
          wrote on last edited by
          #4

          Also, you can use Windows PowerShell like this:

          https://stackoverflow.com/a/59452802/3405291

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved