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?

Improve company productivity with a Business Account.Sign Up

x
 
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.