title: PSEXEC to start calculator on remote server works only when debugging vb.net
body: <blockquote>
  <p>I'm trying to start calculator on remote server using psexec from an ASP.NET app and it works when debugging but not working when start project normally on release below is my code</p>
  </blockquote>
  <pre><code>Dim p As Process = New Process()
      Dim result As String = &quot;&quot;
      p.StartInfo.UseShellExecute = False
      p.StartInfo.CreateNoWindow = True
      p.StartInfo.RedirectStandardInput = True
      p.StartInfo.RedirectStandardOutput = True
      p.StartInfo.RedirectStandardError = True
      p.StartInfo.Verb = &quot;runas&quot;
      p.StartInfo.FileName = &quot;cmd.exe&quot;
      p.StartInfo.Arguments = &quot;/c psexec \\servername -u username -p password calc&quot;
      p.Start()
      p.WaitForExit()
  </code></pre>
  <p>also the command [psexec \servername -u username -p password calc] works fine when execute it in cmd prompt.</p>