Click here to Skip to main content
15,885,906 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello !!! My name is Hamza Chaudhry and i am now in a problem...
i am making a software to open a exe file name "Rufus.exe" i am not the great developer i have tried many help contents but they all are not working. i want a code that i will write and my exe file opens and it will open on other computers also..... I need help please help me i have tried this code


C#
private void button1_Click(object sender, EventArgs e)

    {
        Process p = new Process();
        p.StartInfo.FileName = @"E:\Hamza Development Tools don't Touch This Folder\WindowsFormsApplication6\WindowsFormsApplication6\Rufus.exe";
        p.Start();
        //add reference System.IO or use System.IO.Path and it is "Path"
    }

Please help how can i make my software.........
Posted
Comments
OriginalGriff 2-Aug-13 1:48am    
Sorry, I don't understand what problem you are having.
What is the code doing that you don't want it to, or not doing that you do?
Remember, we can't see your screen or access your HDD, so we have to work from only what you tell us!
Use the "Improve question" widget to add better information.
Hamza Chaudhry 2-Aug-13 5:19am    
how can i post ppictures of the problem to you and others

Keep the exe to be opened in the same path where you have the exe you have developed.

Use "Application.StartUpPath" + exename

Hope this helps.
 
Share this answer
 
Hi,

You can try like this,

C#
try
{
     string path = @"E:\Hamza Development Tools don't Touch This Folder\WindowsFormsApplication6\WindowsFormsApplication6\Rufus.exe";
     ProcessStartInfo pinfo = new ProcessStartInfo(path);
     Process.Start(pinfo);
}
catch(Exception exc) { }



Hope it will work.
 
Share this answer
 
Comments
Hamza Chaudhry 2-Aug-13 13:37pm    
it asks "Exception exc" is excuted and not used
Try:
Process.Start(@"E:\Hamza Development Tools don't Touch This Folder\WindowsFormsApplication6\WindowsFormsApplication6\Rufus.exe");
 
Share this answer
 
Comments
Hamza Chaudhry 2-Aug-13 5:24am    
but that runs the application from only that directory when i move my project to another pc it asks unhandled expression etc.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900