Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there a C# function that executes .exe files?

my question here is pretty simple how do I run a .exe file using C# code? I don’t know how much more clear I can get here.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

using System.Diagnostics;

namespace run_cmd_command
{
    class Program
    {
        static void Main(string[] args)
        {
            string command = "/C notepad.exe";
            Process.Start("cmd.exe", command);
        }
    }
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading