string StarthwPath = Application.StartupPath + @"\scripts\start.bat";
private void StartButton_Click(object sender, EventArgs e)
{
this.RunBat(StartPath);
}
private void RunBat(string batPath)
{
try
{
Process pro = new Process();
FileInfo file = new FileInfo(batPath);
pro.StartInfo.WorkingDirectory = file.Directory.FullName;
pro.StartInfo.FileName = batPath;
pro.StartInfo.CreateNoWindow = false;
pro.Start();
pro.WaitForExit();
}
catch (Exception)
{
}
}