In writing middleware to connect a new asp.net app with some older functionality that this current shop uses I have been challenged to get an asp.net page to execute a .BAT file with command line arguments.
I have seen several models here on ee, and some of the solutions that worked well wouldn't allow for command line arguments. The ones that did have the option for command line arguments simply didn't work for me.
The bat file executes in a win2k3 IIS6 enviornment. The bat file opens up isql, runs a few procedures using ideo sql, then writes a few logs.
I have changed the permissions on the folder and file to run at an adequate level of permission for the isql and the bat.
Has anyone tackled this issue and won?
Thanks a TON for the help!
MRL
using System;
using System.Diagnostics;
public class FileManager
{
public string LaunchFile()
{
string output = "";
Process process=new Process();
ProcessStartInfo startInfo=new ProcessStartInfo();
startInfo.FileName="FILE_P
startInfo.UseShellExecute = false;
startInfo.Arguments="-ARG1
process.StartInfo=startInf
process.StartInfo.Redirect
process.Start();
output = process.StandardOutput.Rea
process.WaitForExit();
return output;
}
}
HTH, Nauman.