Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I want to know how to keep records of copied files to an external disk, such as USB? Does anyone know how to achieve this in coding? Which kind of API can be used to do this?

Thank you
Posted
Updated 15-May-10 22:29pm
v2

I'd reccomend you to create a service whick use WMI to detect USB-drive connection and SystemFileWatcher to create a list of stealed files.
 
Share this answer
 
As daveauld said, this is not an easy task to achieve.
You will need to write a File System Filter Driver[^].
 
Share this answer
 
There is no simple way to achieve this.

A copy operation is not a straight forward audited event on the file system, and therefore cannot be easily traced.

You would need to hook deep into the os to track file read and file write operations and work out what constitutes a copy.

I believe there are commercial auditing products available on the market, which i would suggest you investigate if you are looking for a reliable solutions.

Programmming one yourself is not something i would suggest you undertake.

To get an idea of what is going on you should download a FileMonitor from Sysinternals and watch what activity is going on at the file system level when things are being opened, copied, deleted etc. and you will see it is quite complex.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900