title: start .exe with stored admin password using cmd/powershell
body: <p>I want to create a shortcut to all domain users when it is clicked, e.g. notepad++ in admin mode popup without asking users to input password.
  i.e.<a href="https://i.stack.imgur.com/AzlnG.png" rel="nofollow noreferrer">notepad++ in admin mode</a></p>
  <p>Same effect as I told user the admin username and password and ask them right click notepad++ icon then enter username and password.</p>
  <p>I tried following but it is not working.</p>
  <ol>
  <li>In cmd</li>
  </ol>
  <pre>"runas /savecred /user:{hostname}\admin "C:\Program Files\Notepad++\notepad++.exe"</pre>
  <p>It actually only starts notepad++ in normal mode, even I entered admin password.</p>
  <p>I tried autoit, but since even running the above not starting notepad++ in admin mode, so it is not working too. I think sanur also not working.</p>
  <ol start="2">
  <li>In powershell</li>
  </ol>
  <pre>Start-Process 'C:\Program Files\Notepad++\notepad++.exe' -Verb runAs</pre>
  <p>Elevated window pop up and asking to enter admin username and password, the notepad++ started is in admin mode, but I don't want the pop up. And I couldn't find a way pass in the username and password.</p>
  <ol start="3">
  <li>In powershell</li>
  </ol>
  <pre>$username = "admin"
  $password = "password"
  $credentials = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
  
  powershell Start-Process "C:\Program Files\Notepad++\notepad++.exe" -Credential ($credentials)
  </pre>
  <p>It actually only starts notepad++ in normal mode.</p>