Login | |
|
 |
RE: Folder checking - 4/28/2008 1:04:17 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
Ok, so there are a couple of ways to do this. To be honest with you I would try both then see which is faster and easier to work with. Method one is to use the FileSystemObject to recurse through every folder building a data structure (I would use a dictionary) to hold all the data. The second method is to shell out to the Dir command and pipe the output of Dir to a text file. Then open the text file and build the same data structure from the contents of the file. Personally I think I would use Method 1, but both should get you to the same place.
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Folder checking - 4/28/2008 1:17:22 AM
|
|
 |
|
| |
dm_4ever
Posts: 2220
Score: 32
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
If I remember correctly Dir.exe was several times faster than FileSystemObject when it came to large directories...so like ebgreen suggested...you might pipe it out to a text file. Maybe keep a before and after text file and compare the data between the two using a dictionary, again like ebgreen suggested. You could also work on setting permissions to prevent certain things from happening, maybe some auditing, and if your company uses MS MOM (SCOM) then mayve write to the eventlog to generate alerts. WMI can also be used for monitoring...maybe the Win32_Directory and the __InstanceModificationEvent class.
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Folder checking - 4/28/2008 1:19:56 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
That wasn't what I meant, but it might work. What I meant was to go through the folders building a dictionary of "the way things are" then you would compare that to a seperate dictionary of "the way things should be". So I guess the first question would be how do you determine "the way things should be".
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|