Task: run application from ASP.NET
you have a button on ASP.NET page, when press this button - one application is invoked.
the code to run application (for example, notepad) is (on C#)
but the problem is that the application doesn't run, i.e. no window is opened.
Note that ASP.NET code is executed on the SERVER.
ASPNET user under which application is run should have appropriate security settings.
1. change local policies for APSNET user:
in WinXP: run secpol.msc
go to Local Policies->User Rights Assignment
find "Deny logon locally" and remove ASPNET user from it.
also find "Deny logon .. terminal" and remove ASPNET user from it.
2. Security for files.
if your application needs also to work with files (open, save, etc) you have to change security settings for the folders to allow user ASPNET modify nedeed files.
to do this:
- In Explorer right button mouse click the folder and select "Properties"
- In Security tab, add "ASPNET" in and give desired permissions (Read, Write, Execute, etc).
To test how it works without starting ASP.NET site you can try run in Windows command line:
runas /user:ASPNET "notepad.exe"
it asks you for the password of ASPNET user. enter the password.
if everything is done correct you will see opened application (notepad in our example) in new window.
I've tried this on my Windows XP Professsional and it worked fine.
- Unable to Start a Process from ASP.NET
- ASP.NET Impersonation
- How to configure the process identity for the ASPNET account in ASP.NET 1.1 when you use IIS 5 Isolation mode in IIS 6.0 on Windows Server 2003