Hi Folks
This is my first ever post and i guess i just wanted to offer up some code that i have been working on for a long time.

Description: The Code Starts by taking a scan of a drive you select and puts the Size of the directory, the size of the files including file names and Directory names, including the owner of the file into TXT files. you can then run the program again in 10 seconds or when ever, six months later and it will run a second snapshot the same as the first, and compares the differences. Eg what files have been deleted, changed size, are new files, and who owns the files.
The idea came up in a practical sence when i was doing some helpdesk work for a company and they had very low disk space on there server and over the weekend the server hard drive was completely filled and the server locked up and crashed ready for the users on Monday morning. The manager said what changed and who did it....

I hope you don't think of me as a leach as i have borrow some code from different examples as i am only a newby and have been learning how to write KiXtart script as i write this code.
I know you guys will see that this can be written smarter, faster and i'm hoping that you can offer me alittle constructive criticism, so i can learn how i could have written it better. This code is working code so feel free to try it out.
At the moment it must be run from C:\Program Files\DiskChange
it also requires a few Command Prompt Commands
deltree.exe
treeinfo.exe
xcacls.exe
you will also need to be an Administrator of the Drive you are running this script against.
The Reason i used these commands was because i had no idea how to perform the same task using KiXtart Code.
As for the Adding the Domain\admin Username to Folders that normally are unreadable like the System Volume Information Folder this is because the Treeinfo command can't read it and therefor gives me an unreadable output. So i just made it so it added read attributes to the folder so that it can run correctly.
Once again please forgive my ignorance regarding borrowing Code. GetExtFileProperties is Allen's off this site and it was perfect. So why mess with it. As For any other similarities to other peoples code i'm not sure who as this has been a pet project over the last 18 months. Most of that time was spent trying to make it faster.
Sorry Left out about the Deleting all file excpet part.
You need to create 1 file
[Filesnottodelete.sto]
treeinfo.exe
xcacls.exe
deltree.exe
Filesnottodelete.sto
IDSuite
(also put in the name you called the script.kix file or else it will be deleted after it runs)

Just put in the list the files in the c:\Program Files\Diskchange\ Folder you don't want to delete.


Edited by buckla1 (2007-12-28 03:53 AM)