I understand that this looks like a lot of other questions, but I looked at them for several hours and did not find the real answer that I need, so listen to me:
This is for a .NET C # console application. Inside it, I wanted to call the Windows executable using Process.Start , but without opening it when starting a new console window. I also wanted the executable to be able to output to the console and respond normally to user input.
How do you do this? Install ProcessStartInfo.CreateNoWindow or ProcessStartInfo.WindowStyle ? Try to redirect I / O for several hours in a row?
EDIT: smh ... this is different from the “possible duplicates” there because:
- This is for a console application that wants to run a Windows command without any problems within itself , as if this command was part of the console application itself. For example: create a new C # console application and run the Windows
copy command. - In addition, I need the user to be able to interact with the current command (for example, if
copy asks whether to overwrite, I would like the user to respond), so hiding the window like this , or this possible answer, is no no. - I would like to emphasize how the only
UseShellExecute property solves the problem without erroneous fuzz (for example, I / O redirection) in answers like, or, which again made me spend hours.
Paul Dec 12 '17 at 21:33 2017-12-12 21:33
source share