title: How to run cmd commands as an administrator on C++
body: <p>I want to make a program that runs a command in cmd, but as an administrator, But i'm having hard time understanding how to do it.</p>
  
  <p>I've tried changing my program startup properties to start as an administrator but it still didn't work, when i called system() it wasn't administrator.   </p>
  
  <p>I tried this this solution which I saw <a href="https://stackoverflow.com/questions/15523829/how-to-call-system-in-an-opened-administrator-program-and-gives-it-the-same-pr">here</a></p>
  
  <pre><code>system("runas /user:&lt;admin-user&gt; \"program.exe\"");
  </code></pre>
  
  <p>But i dont undertand how am i suppose to run commands with it like:</p>
  
  <pre><code>system("runas /user:&lt;admin-user&gt; \" COMMAND HERE? \"");
  </code></pre>
  
  <p>when I tried running the solution in cmd i got error saying the file specific as not found</p>
  
  <p>In addition i am trying to do this project avoiding CreateProcess.
  Thank you</p>