Click here to Skip to main content
15,868,340 members
Please Sign up or sign in to vote.
1.30/5 (3 votes)
I Have 2 Applications
1.console applications
2.Windows applications
I need to run console application in the background of the windows application and i need to open the windows application using c#.
Posted
Comments
Black_Rose 17-Apr-15 7:05am    
Not clear..
why you want a console at all?
Does this need a user interface at all?
If not, just make it a windows forms app, and remove the form. Open the "program.cs" file, and replace the code in the Main method
Srikanth59 17-Apr-15 7:09am    
console application have some kind of long running task, so i don't want to show that console application in the windows form

To start up a process you can use the Process class in the namespace System.Diagnostics.
https://msdn.microsoft.com/en-us/library/system.diagnostics.process%28v=vs.110%29.aspx[^]
C#
Process.Start("path\\to\\yourApplication.exe");
 
Share this answer
 
v3
procStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
 
Share this answer
 
I just wrote a huge answer about this. Maybe it will be helpful but it will definitely get you started running background processes.

C# - Read Text From Console Window Asynchronously[^]
 
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