title: VBS to Create Desktop Shortcut with RunAs Arguments
body: <p>My Goal: I am trying to use VBS to create a desktop shortcut for IE under the current user running it with using the RunAs command with arguments and a variable (InputBox) prompt that fills in the variable with the user's input.</p>
  
  <p>OS: Win7 x64</p>
  
  <p>Working BAT: (filling in the domain\username manually)</p>
  
  <pre><code>%windir%\system32\runas.exe /u:Domain\Username "%ProgramFiles%\Internet Explorer\iexplore.exe"
  </code></pre>
  
  <p>NON-working VBS:</p>
  
  <pre><code>set WshShell = WScript.CreateObject("WScript.Shell")
  strDesktop = WshShell.SpecialFolders("Desktop")
  strUser = InputBox ("Please Enter your Domain Account")
  set oUrlLink = WshShell.CreateShortcut(strDesktop &amp; "\RunAs Internet Explorer (Domain Account).lnk")
  oUrlLink.TargetPath = ("%windir%\system32\runas.exe" /u:DOMAIN\"" &amp; strUser &amp; "%ProgramFiles%\Internet Explorer\iexplore.exe")
  oUrlLink.IconLocation = "%ProgramFiles%\Internet Explorer\iexplore.exe"
  oUrlLink.Save
  </code></pre>