There is no such thing as "DOS Batch file" anymore! How much longer shall we see such questions about something which does not exist.
Batch files are batch files; there is nothing of DOS in them. By the way, the syntax became more advanced compared to DOS time; writing batch became considerably easier (for example, there are procedures now).
Now, you don't need to run this Process. Running external processes can be used only as a last resort. You need to get the files in your application code:
string[] files = System.IO.Directory.GetFiles(myDirectory);
For other options, please see other overloaded
System.IO.Directory.GetFiles
methods:
http://msdn.microsoft.com/en-us/library/07wt70x2.aspx[
^].
Never use hard-coded immediate constants like "
d:\t-ware\mytest.bat
". How would you maintain them? In particular, all directories should be calculated our of your entry assembly location and/or configuration data.
—SA