starting an app from ASP.NET

  • Thread starter Thread starter spmm#
  • Start date Start date
S

spmm#

Hi!

Can someone explain how I can properly start (e.g.) notepad from an
ASP.NET/C# page?? I've been googling for a day now, but no one seems to
experience
the same trouble as I do.

I gave the ASPNET user administrator rights and followed these two articles
from msdn:
http://support.microsoft.com/default.aspx?scid=kb;en-us;555134
http://support.microsoft.com/default.aspx?scid=kb;en-us;317012

After doing this I am able to start (e.g.) Notepad like this:
Process.Start("notepad");

I see a part of the title bar of the notepad window appearing and notepad
also appears in the taskbar, but that's it. (I tried making a screenshot,
but that appears to be impossible).

Does anyone know how to solve this??

Thanks.
 
Where do you want this to start? On the client or the server side?

Either way, the page is being rendered on the user's machine. The
ASPNET user is a local user on the server side which the page is being
rendered and performing operations under. When you open notepad in your
code through the Process class, it is running on the server, not on the
client side.

Now if this is what you want, then you should just do what you are
doing, and it will work. However, I STRONGLY suggest that in practice, you
don't elevate the ASPNET account to an administrator, as this is a huge
security hole. I would create another account with the rights to ONLY run
this executable, and then impersonate that account on the page that is
running the executable.

If you want to run the program on the client side, then none of this
applies, since you don't have rights (by default) to do that. You would
have to either embed an ActiveX control in the page, or a .NET control which
is given the rights to execute applications.

Hope this helps.
 
Thanks,

Actually, what I want to do is start a macro in MS Access from my aspx
(after hitting a button). The command would look like this: "MSACCESS.EXE
c:\test.mdb /x Macro1". Your remarks made realise it might be better to
execute this client-side. I don't have a clue how do get this running /
embed an active x or .Net component. Do you have some suggestions / links on
the subject??

Thanks!
 
spmm#

I don't think that executing this on the client side would be a good
idea. The reason for this is that it would be a huge headache.

It might be roundabout, but perhaps you should have the client specify
the MDB file to upload to the server, have the server perform operations on
it, and then return it back to the client?
 
Back
Top