Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How it is possible to survey a folder and its subfolders

Status
Not open for further replies.

FaneDuru

Technical User
Jul 15, 2002
141
RO
I mean I need to make a log about the deleted files/subfolders and new ones which appear inside the surveyed one. The time of deletion or creation must be also logged (even if it is not exactly the real one in case of deletion...)
I know only to issue an initial log file containing all existing files and folders. I think of making from time to time a loop through all folders and files and report the results to the initial file... Is it something done on that issue in order to avoid doing the same thing? I looked to the FAQs but I did not find something in order to help me.

Thanks in advance,
Fane Duru'
 
If you are looking to really capture file deletions you are going to need to use a WMI Event Consumer Script. I recommend the book Windows Scripting With WMI Self Paced Learning Guide by Ed Wilson published by Microsoft Press.

Note my review on Amazon:
Great book with lots of good examples. Note correction below., February 8, 2007
By Mark D. Maclachlan (Gilbert, AZ) - See all my reviews

I recently attended a Microsoft sponsored workshop that was taught by the author of this book. I learned a great deal. If for nothing else, this book is worth purchasing to get a hold of the event consumer scripts. Important note: The author made the class aware that a line was missing in the event consumer script in both the print and companion CD versions.

To get the script to run, at the bottom of page 110 add the following line of code.

objfilter.EventNameSpace = "root\cimv2"

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Thanks!
The suggested approach looks more appropriate.

Fane Duru'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top