title: Can I get the return value of Shell.Application's ShellExecute?
body: <p>I'm using VBScript to create a UAC prompt for a batch file. I don't know how to get the return value of the UAC prompt. For example if I try to UAC a file that doesn't exist I should get an error, right?</p>
  
  <p>For example:</p>
  
  <pre><code>Dim rc
  Set UAC = CreateObject("Shell.Application") 
  rc = UAC.ShellExecute("thisdoesntexist.exe", "", "", "runas", 1)
  WScript.Echo rc
  </code></pre>
  
  <p>rc doesn't contain a code. Also, is there any way I can get the error code of whatever I'm executing? Is ShellExecute asynchronous in VBScript?</p>