Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Process is not executing

Status
Not open for further replies.

pratibha14

Technical User
Mar 2, 2004
30
0
0
Hi,

I want to execute commands through .NET.

Using process, i can execute them in WindowsApplication but the process doesn't work in WebApplication.
I am executing a batch file which contains some commands to be executed. They don't have any UI and works in backgroud.

Can it be security related issue with ASP.NET user? For that, I access the web page as Administrator through impersonation and not through ASP.NET user.

Can you guys tell me why batch file is not executing in WebApplication while it works with WindowsApplication and If it has any other way to be done?

Thanks
 
You will probably fins that it is a security/permissions issue. If you start a process from an ASP.NET application (e.g. faq855-5802) you will see that it launches under the ASPNET account (if you have a look at Task Manager).

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Yes ca8msm..
When I run "Calc" instead of my batch file, it is executed.

I am starting a windows service through my batch file (I know this can be done using System.ServiceProcess).

To whom and How to provide permission, if its a security related problem?

Thanks
 
From my experiences with these types of security issues it's not actually that straight-forward. If you use impersonation and start a process, I think the process will gain the rights of the user that they are impersonating but if you look at task manager the process will still have launched under the ASPNET account.

I've had very similar experiences and haven't found a suitable solution that I would feel confident recommending so until then (or until you find your own solution that you are happy with) you will have to just play about with the permissions of the ASPNET account and the impersonated account.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
If you are using Windows 2003 then the most common problem is probably faq855-5807 although that second link that Ecreations pointed out may come in useful for you situation (my scenario wasn't using a bat file).

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Still no luck.

I am using Windows XP and I tried to go through all combinations of permission. But hard luck.

Through the example given by "Ecreations", it shows successfull execution but actually doesn't start the windows service.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top