Cannot start .exe from aspx page

D

DotNetJunkies User

Hi All,

Hope someone can help me out with this problem.
I tried to start a process(notepad.exe) from a web form, but it is not started. Neither the aspnet_wp.exe nor my notepad.exe is shown in the Taskbar.

Here is my code:

private void Button1_Click(object sender, System.EventArgs e)
{
try
{
Process p = new Process();
p.StartInfo.FileName = "C:\\Windows\\notepad.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = false;
p.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
p.Start();
}
catch(Exception exp)
{
txtResults.Text = exp.StackTrace;
}
}


Awaiting for your replies
Thanks
Madhavi
 
A

Alvin Bruney [MVP]

presumably, notepad...wait i thought notepad was in c:\windows\system32,
anyway you don't need the path since notepad by default is in the env. var.
but i would check to see if execute permissions existed. typically, it does
not have permissions by default.
 
C

Curt_C [MVP]

Notepad would be useless to start. You wont be able to use any user based
app that way. Now you should be able to execute files, that's not a big
deal. Just make sure the user that ASP.NET and the Site are running under
has permissions to do this. FYI, you do realize this is trying to execute on
the SERVER right?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


DotNetJunkies User said:
Hi All,

Hope someone can help me out with this problem.
I tried to start a process(notepad.exe) from a web form, but it is not
started. Neither the aspnet_wp.exe nor my notepad.exe is shown in the
Taskbar.
Here is my code:

private void Button1_Click(object sender, System.EventArgs e)
{
try
{
Process p = new Process();
p.StartInfo.FileName = "C:\\Windows\\notepad.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = false;
p.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
p.Start();
}
catch(Exception exp)
{
txtResults.Text = exp.StackTrace;
}
}


Awaiting for your replies
Thanks
Madhavi
engine supports Post Alerts, Ratings, and Searching.
 
G

Guest

Like Curt said, your asp.net code is running on the server, so my guess is that you are starting up a whole lot of notepad session windows on the server. The admin must be real fustrated with you. You will never get notepad to open up this way. And I doubt that you can run client side code to get this to start up, since this is a security issue.
 
G

Guest

Like Curt said, your asp.net code is running on the server, so my guess is that you are starting up a whole lot of notepad session windows on the server. The admin must be real fustrated with you. You will never get notepad to open up this way. And I doubt that you can run client side code to get this to start up, since this is a security issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top