:: Think Code Execute ::

Think Code Excute

:: How To Run CMD Dos Command in C#.net ::

Its easy you only need to use process :)

System.Diagnostics.Process.Start(“CMD.exe”,”cd ..”);

this how we do it :)

if you need to terminate the dos after excution the dos command you just need to put /C

System.Diagnostics.Process.Start(“CMD.exe”,”/C dir”);

you also can yous multiple dos command at the same time like
System.Diagnostics.Process.Start(“CMD.exe”,@”/C cd\ & myapp.exe “);

have a nice day :)


January 15, 2009 - Posted by eshbeata | :: C#.net :: | , , , | No Comments Yet

No comments yet.

Leave a comment