Click here to Skip to main content
15,890,043 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I need to log all files copied to a usb drive.
Also, I need to know what file is being copied with path and the destination location?

There is sort of a similar solution on this
http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/68c39481-bbdd-4866-a8f3-3e4c6f163fe0

But I'm unable to understand what language it has been written in.

Please help.
Posted
Updated 13-Jan-11 22:38pm
v3
Comments
JF2015 13-Jan-11 0:14am    
Edited to fix the link.
Dalek Dave 14-Jan-11 4:38am    
Edited for Grammar and Readability.

The best you can do is enumerate all currently inserted USB storage devices (and handle the add/remove system events for such devices), and then use the SystemFileWatcher object to monitoir those drives. I wrote a 2-part article series about using the FileSystemWatcher object that you might want to check out:

FileSystemWatcher - Pure Chaos (Part 1 of 2)[^]

FileSystemWatcher - Pure Chaos (Part 2 of 2)[^]

 
Share this answer
 
v2
That's a MOF file, not a normal programming language. MOF is Managed Object Format. That example is using WMI to notify an email recipient that a file is being created on a certain drive letter.

Read up on WMI and MOF files and you'll be able to implement this.

There is no way to determine is a file is being copied or if data is just being written to a file on a drive. A file copy operation is nothing more than opening the source file for Read access and the destination file for Write access. Then the source file is read and the data written to the destination file. There's nothing special that says that this operation is really a copy operation.
 
Share this answer
 
Thnks John Simmons,
The article was a great help,I downloaded the Demo,works perfectly( as if you didnt know),i havent though tested it on the removable devices.Hope that works.
finally,is there sumthing that would show the contents copied/some kind of a screenshot of the files copied....i know it seems like a far cry...just curious.If so,please let me know.Thanks again.L8r.
 
Share this answer
 
Comments
#realJSOP 14-Jan-11 5:29am    
The demo merely shows what's happening to the file because the FileSystemWatcher can't tell you what's been copied in the file, nor can it tell you the progress. It only reflects events from the file system. If you need some sort of progress indicator while the file is being copied, you need to manage the file copy process yourself (I think, but I might be wrong - I'm always discovering new stuff in the .Net framework).
ok,Thanks....and just wannted to check if this is familar to your acticle???
http://www.codeproject.com/KB/system/USBMonitor.aspx
 
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