views:

67

answers:

2

In Windows, is there a way to find out when an executable was last executed?

It seems unlikely that something like this would be saved, but I'm open for other suggestions.

It would be enough to know if it was executed "recently", for example since the computer was started, the last hour etc.

I'm open for hackish ideas, like checking the pagefile to maybe see traces left by an executable?

A: 

I'm not sure if this is what you are looking for but you could implement some kind of process watcher that would check all the running processes and log the ones you want. That would help from here on in but I can't think of anything that would help detect the last time an executable ran when that logging functionality wasn't in place.

Zerodestiny
+2  A: 

You can do this with auditing. Run gpedit.msc, Computer Configuration, Windows Settings, Security Settings, Advanced Audit Policy Configuration, System Audit Policies, Detailed Tracking, Audit Process Creation. Ask more questions about it at superuser.com

Hans Passant
(1) Can this be turned on programmatically?(2) Does it have any negative aspects (performance?), i.e would the users of my program be upset if I turned it on when installing my app?(3) Can the results be read programmatically?
truppo
No, possibly, yes (EventLog class). Your installer should not mess with your client's security settings. Logging info about programs that you don't own is suspicious.
Hans Passant