I have an problem with one program that I am developing. My issue is this.
I have one file bat with several commands inside. And this file bat HAVE TO run with Console2(VS2008 Prompt), is not allowed run with cmd.exe.
Then, I want develop an program with C#, that call Console2 and after that call the file bat, to run the file bat inside of the Console2.
My problem is that my program in C# get call the console2, but donīt get call the file bat to run with Console2.
What is happen with my program, anyone can help me.
Following one piece of my code
Process proc = new Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
When I use cmd.exe in my program c#, the cmd.exe get call the bat file.
But when I change the "FileName" to Console.exe, my program donīt get call the bat file.
My bat file must run with Console.exe and donīt with cmd.exe.
Just with Console.exe.
The same comment as Arjay already has provided but maybe a little more explicit.
Since cmd.exe starts without any problems there's a good chance that you need some extra parameters when starting console.exe. Check what's done (properties) when you start console.exe from the start menu.
Is it possible to start console.exe (with path) from cmd.exe?
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
- Brian W. Kernighan
Bookmarks