Vb net execute command line program
I am writing an application that will call a command line application. Text End With ' Execute the process and wait for it to exit If p. Start Then p. Message, MsgBoxStyle. Critical, "System Notification" End Try If lets say that a user could not be found, the command line program will tell me about it as seen here: A problem occured.
The password for this mailbox could not be changed. The specified domain either does not exist or could not be contacted. Is there a way that I can get these messages to appear in my VB.
Try Catch will not grab these. Close ' Wait for the sort process to write the sorted text lines. WriteLine "" 'Console. Close Else 'Console. WriteLine " No input lines were sorted.
If you liked this article please do leave a reply and share it with friends. Leave a Reply Cancel reply Your email address will not be published. All rights reserved. Add a Solution. Accept Solution Reject Solution. Start by using the debugger, and look at the string you are sending to the system, including the path that you tack onto the CD command.
Then, remove the "exit" and process. Close commands, change your StartInfo to create a window, and look at exactly what the command is doing with your inputs by reviewing it's responses. I'd set the EXE file as the process to start, and pass the remaining data as the parameters to that command - and set the WorkingDirectory property of the ProcessStartInfo object instead of faffing with the input at all.
Posted Apr am OriginalGriff. Aravindba Apr am. Hi, yes i changed code like this Dim process As New System. Process process. GetDirectoryName System. DoEvents process. FLEX process. DoEvents ' process. ReadToEnd 'process. OriginalGriff Apr am.
Maciej Los 6-Dec pm. Have you tried with Process. Top Rated Most Recent. Accept Solution Reject Solution. Posted 5-Dec am rysiel chyba ty. Posted 2-Dec am Anisuzzaman S umon. Add your solution here. OK Paste as. Treat my content as plain text, not as HTML. Existing Members Sign in to your account. This email is in use. Do you need your password? Submit your solution! When answering a question please: Read the question carefully.
0コメント