Calling an .exe inside VB.NET
-
Hi! I have a program that only runs the way I want it to from cmd line. Such as: > myprogram "c:\mydirectory\file.dll" Now, I want to automate running this program against a lot of dll's so the argument in the cmd line is bound to change. And the other thing is, I need to parse the output of the program dumped to standard out. So essentially, what would be great is if i can call something like: > myprogram "c:\mydirectory\file.dll" > output.txt I have the following code so far --------------------------------------------------- Dim p As New Process() Dim p_info As New ProcessStartInfo() p_info = p_info.RedirectStandardOutput = False p_info.UseShellExecute = True p_info.FileName = "myprogram.exe" p_info.Arguments = "c:\mydirectory\file.dll" p.Start(p_info) --------------------------------------------------- I tried setting UseShellExecute to false and for some reason, myprogram doesn't launch properly. I can't have UseShellExecute and RedirectStandardOutput both true. So how do I accomplish getting this standard out? Thanks for the help!
-
Hi! I have a program that only runs the way I want it to from cmd line. Such as: > myprogram "c:\mydirectory\file.dll" Now, I want to automate running this program against a lot of dll's so the argument in the cmd line is bound to change. And the other thing is, I need to parse the output of the program dumped to standard out. So essentially, what would be great is if i can call something like: > myprogram "c:\mydirectory\file.dll" > output.txt I have the following code so far --------------------------------------------------- Dim p As New Process() Dim p_info As New ProcessStartInfo() p_info = p_info.RedirectStandardOutput = False p_info.UseShellExecute = True p_info.FileName = "myprogram.exe" p_info.Arguments = "c:\mydirectory\file.dll" p.Start(p_info) --------------------------------------------------- I tried setting UseShellExecute to false and for some reason, myprogram doesn't launch properly. I can't have UseShellExecute and RedirectStandardOutput both true. So how do I accomplish getting this standard out? Thanks for the help!
never mind i found how it works http://www.devx.com/dotnet/Article/7914/0/page/5