W
wmotter
I have a requirement to execute a legacy DOS program from within an
ASP.NET Website. I have it working in my sandbox machine but when I
put it live and select the option via asp:button the site simply
refreshes and no new window with said DOS application appears. The
application is present in the task list on the server. The
environement is windows 2003 with IIS 6.0. I have checked the 'Allow
serviec to interact with desktop' check box in the IIS Admin services
and have modified the machine.config process model tag to
<processModel userName="SYSTEM" password="AutoGenerate" /> as per the
msdn article 'Unable to Start a Process from ASP.NET' (not sure that
is exactly what I should put). I have tried to modify the IIS_WPG
group to allow system privileges and even assigned it adminstrator
rights for a bit to see if that did anything. I have also played
around with the ASPNET account in IIS and gave in admin privileges to
see if that does anything. I added the process code that starts the
app below but since I see it in the task list I assume that is good.
I can't think of anything else I can do any help would be appreciated.
System.Diagnostics.Process cmd = new System.Diagnostics.Process();
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.UseShellExecute = false;
bool started = cmd.Start();
if (started)
{
Button btn = (Button)sender;
string arg1 = btn.CommandArgument.ToString();
cmd.StandardInput.WriteLine(@"D:\wincmd\TotalCmd.exe",
arg1);
cmd.StandardInput.Flush();
cmd.StandardInput.Close();
}
ASP.NET Website. I have it working in my sandbox machine but when I
put it live and select the option via asp:button the site simply
refreshes and no new window with said DOS application appears. The
application is present in the task list on the server. The
environement is windows 2003 with IIS 6.0. I have checked the 'Allow
serviec to interact with desktop' check box in the IIS Admin services
and have modified the machine.config process model tag to
<processModel userName="SYSTEM" password="AutoGenerate" /> as per the
msdn article 'Unable to Start a Process from ASP.NET' (not sure that
is exactly what I should put). I have tried to modify the IIS_WPG
group to allow system privileges and even assigned it adminstrator
rights for a bit to see if that did anything. I have also played
around with the ASPNET account in IIS and gave in admin privileges to
see if that does anything. I added the process code that starts the
app below but since I see it in the task list I assume that is good.
I can't think of anything else I can do any help would be appreciated.
System.Diagnostics.Process cmd = new System.Diagnostics.Process();
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.UseShellExecute = false;
bool started = cmd.Start();
if (started)
{
Button btn = (Button)sender;
string arg1 = btn.CommandArgument.ToString();
cmd.StandardInput.WriteLine(@"D:\wincmd\TotalCmd.exe",
arg1);
cmd.StandardInput.Flush();
cmd.StandardInput.Close();
}