View Single Post
Old 11-22-2008, 08:23 AM   #1 (permalink)
j8ear
Gentlemen Farmer
 
j8ear's Avatar
 
Location: Middle of nowhere, Jersey
can someone help me script something...

I hope this isn't to imposing on someone with the right skill set...but I need some help. I could probably spend a week or two teaching myself how to do this, but my time horizon is much more pressing.

Here's my deal: I have 10000 plus directories, within each are a few files that are essentially a hosts files from a windows workstation. This is all sloppily pulled by SMS, and extracted from a SQL DB I think. The SMS folks and the SQL DBs are no longer in the picture. My directory and file names are codes that apparently relate back to data in the DB.

I need to find the files within each directory that match the default hosts file (usually located here: C:\WINDOWS\system32\drivers\etc) on a windows workstation and delete them. Then I need to delete empty directories.

This should leave me only with directories which contain hosts files that DO NOT match the default hosts file from a windows workstation.

I'm told this should be relatively easy with a batch file doing some FOR and FC commands, directory "looping," and error level output reading?

I'm happy to give more background if needed.

I'm a little over my head (in that I'm not a scriptor or programmer), new to this environment, and kind of being tested. I'd really like to pass this "TEST"

Any help would be greatly appreciated.

-bear
__________________
It's alot easier to ask for forgiveness then it is to ask for permission.
j8ear is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37