Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
ok great thx .. i never thought to look in the diagnostic area hehe. What would you use if you have to supply a password to the command prompt after running an application with this... such as with the 'runas' command?
Posted
ok great thx .. i never thought to look in the diagnostic area hehe. What would you use if you have to supply a password to the command prompt after running an application with this... such as with the 'runas' command?

 

SendKeys and Win32Window.

 

Use Win32Window to find the command prompt window, and then use SendKeys to supply the username and password.

  • *Experts*
Posted

You could also use the stream redirection provided by the process class.

Dim pi As New ProcessStartInfo("file name")
pi.RedirectStandardInput = True 'redirect the input to a stream you can write to
pi.UseShellExecute = False 'required statement to use stream redirection
Dim pr As Process = ProcessStart(pi) 'start the process using the process start info we created earlier
dim sw As Io.StreamWriter = pr.StandardInput

You can write to the stream now and the console window will receive the input (the input will not be shown on the console window).

Posted
You could also use the stream redirection provided by the process class.

Dim pi As New ProcessStartInfo("file name")
pi.RedirectStandardInput = True 'redirect the input to a stream you can write to
pi.UseShellExecute = False 'required statement to use stream redirection
Dim pr As Process = ProcessStart(pi) 'start the process using the process start info we created earlier
dim sw As Io.StreamWriter = pr.StandardInput

You can write to the stream now and the console window will receive the input (the input will not be shown on the console window).

 

much cleaner, very nice.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...