Below are different code I have used but I need to execute ETL or batch file gave link to button dashbord via view page but I couldn't execute or run file please suggest me on same
public ActionResult RunETL(){
try
{
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo = new System.Diagnostics.ProcessStartInfo(@"D:\Jobs\Execute");
p.Start();
//Process p = new Process();
//// Redirect the output stream of the child process.
//p.StartInfo.UseShellExecute = false;
//p.StartInfo.RedirectStandardOutput = true;
////p.StartInfo.FileName = @"D:\Jobs\Execute";
//p.Start();
//// Do not wait for the child process to exit before
//// reading to the end of its redirected stream.
//p.WaitForExit();
//// Read the output stream first and then wait.
//string output = p.StandardOutput.ReadToEnd();
//p.WaitForExit();
//Response.Write("Done");
////ViewBag.Result = "ETL Running";
}
catch (Exception ex)
{
//ViewBag.Result = ex.Message;
}
return RedirectToAction("Home");
}