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. Run cmd command from QProcess without admin privileges
Qt 6.11 is out! See what's new in the release blog

Run cmd command from QProcess without admin privileges

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 944 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.
  • T Offline
    T Offline
    TomNow99
    wrote on last edited by
    #1

    Hi,

    I know - my problem is very strange.

    I would like to execute one CMD command from my QT application ( it has admin privileges ) but it must be execute by current user.

    When I execute:

    process->start(R"(hereCmdCommand)");
    

    I execute it with admin privileges, so it doesn't work. I try with "runas", but It doesn't work too ( when I execute it in cmd - I need password and I don't want it ). I try with bat script ( I use windows ). When I double click on it in GUI everything is ok ( in this script I run cmdCommand ). When I execute:
    When I execute:

    process->start(R"(script.bat)");
    

    The result is the same like using

    process->start(R"(hereCmdCommand)");
    
    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

      It's not that strange of a problem...It's the pleasures of working in windoze.

      The dystopian literature that served as a warning in my youth has become an instruction manual in my elder years.

      1 Reply Last reply
      0

      • Login

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