sjesweak Posted February 28, 2004 Posted February 28, 2004 Is there anything in the .NET Framework that worked like the exec family in C and if so does anyone have any examples on it? Quote
sjesweak Posted February 29, 2004 Author Posted February 29, 2004 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? Quote
HJB417 Posted February 29, 2004 Posted February 29, 2004 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. Quote
*Experts* mutant Posted February 29, 2004 *Experts* Posted February 29, 2004 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). Quote
HJB417 Posted February 29, 2004 Posted February 29, 2004 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.