Start any exe from Windows Application

Here i have given the the example of start notepad.exe

            System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo.FileName = "notepad.exe";
            p.StartInfo.Arguments = @"C:\Users\XYZ\Desktop\hi.txt";
            p.Start(); 
            p.Close();


here, you can define fullpath of exe in Filename Propery of StartInfo.

if an Exe application is taking any command line argument then you can also give Arguments.
here i have given the filename. so notepad is opened with that file.


Ebook Download
View all
Learn
View all