Click here to Skip to main content
15,898,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to run a batch file from C# code using ProcessStartInfo class and want to log its output to the table by calling a Stored Proc.
I am able to execute batch file from the code, but not able to log its output.
Can anyone please help me with this functionality?
Posted
Updated 19-Nov-15 1:18am
v2

1 solution

First, capture the output - MSDN[^] shows you how to do that.

Then it's up to you: if you just want the whole output as a column, just pass the string to SQL via a Parameterized INSERT query.
If you need to break it into several rows, or columns, or both then you need to look closely at the output data - there is no advice which will fit every data format!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900