title: How to make windows' runas.exe take password from credential manager with no prompt?
body: <p>I am trying to create a shortcut that would take credentials from the credential manager, like so</p>
  
  <pre><code>cd C:\code\Kodex-1.4.3\EPD_Prerequisite\Anaconda2\
  $line1 = "cd C:\Code\EPMD\Kodex-1.4.4\Applications\Bin\EpmdTaskManager"
  $line2 = "start EpmdTaskManagerGui.exe hide"
  $line1 | out-file auto1.bat -Encoding Ascii
  $line2 | Out-File -append auto1.bat -Encoding Ascii
  $WshShell = New-Object -comObject WScript.Shell
  $Shortcut = $WshShell.CreateShortcut("C:\Users\matanv.HOBART\Desktop\Kodex 1.4.4.lnk")
  
  $Shortcut.TargetPath = """C:\WINDOWS\system32\runas.exe"""
  $argA = "/user:%computername%\Admin /savecred"
  
  $argB = """C:\code\Kodex-1.4.3\EPD_Prerequisite\Anaconda2\auto.bat"""
  $Shortcut.Arguments = $argA + " " + $argB
  $Shortcut.Save() 
  </code></pre>
  
  <p>This works fine, with one problem: The first time I run the script, I get promted for password.</p>
  
  <p>I want to never get prompted for password, and to store it in the credential manager using some (maybe other) script.</p>
  
  <p>How can it be done?</p>
  
  <p>Thanks</p>