Dear Sirs,
I need to create a form with a button, when the button is clicked I need
to run an access application residing on the local drive, how can I do this?
Regards,
Yahya
Arjang - 06 Aug 2005 08:23 GMT
System.Diagnostics.ProcessStartInfo
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemdiagnosticsprocessstartinfoclasstopic.asp
following example is from:
http://www.csharpfriends.com/Forums/ShowPost.aspx?PostID=35176
public static void Main(){
ShellRun("c:\progfiles\winace\winace.exe", "A C:\myfiles\*.*
c:\mypacketfile.ace")
}
//exefile is the path to the executable.
//pars is all the parameters you use
public static int ShellRun(string exefile, string pars){
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = exefile;
myProcess.StartInfo.Arguments = pars;
myProcess.StartInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Visible; //use .Hidden if you dont
want to see anything
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
myProcess.WaitForExit(60000); //60 sec timeout
return myProcess.ExitCode; //Returns exit code
}
> Dear Sirs,
>
[quoted text clipped - 5 lines]
> Regards,
> Yahya