Run an access application

  • Thread starter Thread starter Yahya
  • Start date Start date
Y

Yahya

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
 
System.Diagnostics.ProcessStartInfo

http://msdn.microsoft.com/library/d...stemdiagnosticsprocessstartinfoclasstopic.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
}
 
Back
Top