Click here to Skip to main content
15,848,451 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to call command prompt in the c#?The command to run the c# program.Once Running the program.
Please write a few examples of the command line.
Posted
Updated 20-Dec-11 11:56am
v12

Try google[^] to help get you started.
 
Share this answer
 
Comments
thatraja 20-Dec-11 15:17pm    
5!
sajad abbasi 20-Dec-11 15:23pm    
What is?
You can use Process.Start to execute an OS command, see for example: http://msdn.microsoft.com/en-us/library/0w4h05yb.aspx[^]
C#
Process.Start("cmd.exe");
 
Share this answer
 
v2
Comments
thatraja 20-Dec-11 15:17pm    
5!
Wendelius 20-Dec-11 15:37pm    
Thanks, and for the edit also :)
Sergey Alexandrovich Kryukov 20-Dec-11 18:39pm    
I think that's not all or not exactly it. OP mentioned: "The command to run the c# program".

Please see my solution.
--SA
Wendelius 21-Dec-11 0:28am    
That could well be true.
I think the problem was about starting some console application and showing the console or controlling in what console it should be shown. To do that, using CMD.EXE is not needed. These problems are solved using appropriate setup of System.Diagnostics.ProcessStartInfo.

See what options you can use: http://blogs.msdn.com/b/jmstall/archive/2006/09/28/createnowindow.aspx[^].

See for more detail:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[^],
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.aspx[^].

—SA
 
Share this answer
 
Comments
Wendelius 21-Dec-11 0:27am    
This could be the case for OP. 5'd
Sergey Alexandrovich Kryukov 21-Dec-11 1:02am    
This is how I understood it.
Thank you, Mika.
--SA
 
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