retrieve messages from batch files

I'm using vb 2008 with asp.net 3.5.  The program writes a batch file on the server using a streamwrite like this.  It then runs the batch file using a shell command as per the last line.
There are two errors I want to trap.
The ID and password are incorrect.
The file was not present on the server being accessed by the batch file.

If an error happens I want to display a meaningful message in Internet Explorer.  How do I do this?
The batch file is attached (with hostname, ID and password changed).
Attachment.txt
AlHal2Asked:
Who is Participating?
 
Miguel OzConnect With a Mentor Software EngineerCommented:
The attached code only shows how to generate the batch file, not how the file is executed.
Any way, you can use Process StartInfo.RedirectStandardOutput property  = true to run your batch file as shown in the link below:
http://www.dotnetperls.com/redirectstandardoutput
0
 
Miguel OzSoftware EngineerCommented:
Please post the code that runs your batch file. I need to see what you are using.
Basically you need to capture the screen output and display it in a label in your page. Is this OK for you?
0
 
AlHal2Author Commented:
Please let me know what you need beyond what's in the attachment.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Miguel OzSoftware EngineerCommented:
I need:
1) The code that runs the batch file you save in the attachment
2) Answer to my question above.
0
 
AlHal2Author Commented:
The code in the attachment is generated when the user presses a button.
I would like to capture the screen output and display it as a label in the page.
Hope this clarifies things.
0
 
AlHal2Author Commented:
Thanks.  I used the shell command at the bottom of the attachment to execute the batch file, but I think your method is better.
0
All Courses

From novice to tech pro — start learning today.