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

Posted on 2003-03-02
Medium Priority
Last Modified: 2010-05-01
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.
Question by:chpchai
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 28

Expert Comment

ID: 8052101
LVL 28

Accepted Solution

vinnyd79 earned 150 total points
ID: 8052108

Expert Comment

ID: 8053858
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.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question