Link to home
Start Free TrialLog in
Avatar of chpchai
chpchai

asked on

How to detect file operations in the window using VB code?

Is it possible to detect any operation on files, such as move, delete, rename a file. And can vb code undo such file operation? What I mean is a real time detection that whenever a operation is done on a file, the vb code can detect.
Avatar of vinnyd79
vinnyd79

ASKER CERTIFIED SOLUTION
Avatar of vinnyd79
vinnyd79

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It is possible to detect such operations on files through a number of means.  I would recommend using a visual basic timer control in combination with the FileSystemObject object offered under the "Microsoft Scripting Runtime" reference.

Basically, the visual basic timer control can execute code which you specify on a given interval.  The FileSystemObject can get you information about folders and files including names of folders, names of folders in files, and file properties such as read-only and archive.

Depending on your situation, you can have a program with a timer...the timer scans folders or files you are interested in, and reports changes to you based on differences found between times in which the timer control ran specified code.  

..I'd be happy to elaborate if you give more specifics about your situation.