How to run .EXE on button click in C#

By Raj Kumar Beniwal Nov 04, 2008
This code will show you how to run a executable file(.exe) on a button click.

using System.Diagnostics;

This namespace provides access to local and remote processes and enables you to start and stop local system processes.

protected void Button1_Click(object sender, EventArgs e)
       // string str = @"C:\windows\system32\notepad.exe";

       // string str  = @"C:\windows\system32\winamp.exe";

        string str  = @"C:\Documents and Settings\RAJ\Desktop\MCNewsLetter\SendNewsletter.exe";
        Process process = new Process();
        process.StartInfo.FileName = str;

Raj Kumar Beniwal

Raj Kumar Beniwal is two times Microsoft MVP(Client App Dev) and four times C# Corner MVP,  working as asst project manager with lots of hands on experience using ASP.NET 2.0/3.5, AJAX, MVC, C#, Visual Basic .NET, S... Read more



Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs