Home Ask Login Register

Developers Planet

Your answer is one click away!

zzzbatmand February 2016

c# See what process is changing filename of specific file

Is there a way in c# to find out what process is changing a name of a file when it's changed. I know how to see if the name is changed, but is there a way to see exactly what program/process that is doing it?

Answers


bigtime813 February 2016

By enabling SACL in active directory or locally on the computer, you can audit who changed a file on a computer. Then you can configure a C# application to monitor the eventvwr.msc for any file changes. Follow these instructions to setup auditing: https://support.microsoft.com/en-us/kb/814595.

Another suggestion is to use this existing C# application to find out who has a lock on the file: https://gist.github.com/i-e-b/2290426.

I believe monitoring the eventvwr.msc will be a better approach, because it gives you the flexibility to monitor a range of modifications (read,write,delete,update,changes,locks).

Post Status

Asked in February 2016
Viewed 1,568 times
Voted 12
Answered 1 times

Search




Leave an answer


Quote of the day: live life