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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using GetProcessTimes

Status
Not open for further replies.

noodles1

Programmer
Oct 31, 2001
58
I have a Web Application (ASP) that launches instances of Excel & Winword and on occasion these processes do not terminate.

I am trying to write a house keeping scheduled task that will clean up these dormant processes if the process creation time is beyond a certain point. These processes are run under the same identity as the Web Application.

I have created the house keeper utility that uses GetProcessTimes to determine process age and then TerminateProcess to remove if the process meets age minimums.

Is is enough to run process terminator under the same identity as the Web App to be able to successfully use GetProcessTimes and TerminateProcess? If not, do I need to acquire security descriptors when getting the handle to the process for use by GetProcessTimes etc?

I have successfully tested the application interactively, however I am getting Error 5 conditions when running under production deployment. ie. Web app launched Excel etc. and scheduled task
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top