Skip to content

How to Execute a DOS command in Visual Studio, HOW?

Gizmo

Asked Apr 22, 2006, 1:42 PM EDT1 answer
Share
LinkedInX
Hello I want to have a buttonClick event such that when the button is clicked... it should run a ".BAT" file that is in the same folder. In other words, how do I invoke command line commands from a C# program? Thanks in advance! :)

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • +1
    Well, Most Probably, you need the System.Diagnostics.Process.Start Method. You can use that to run any External App, and your BAT File as well.
    +1