Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Delete Directory Based on File Inside?

Author  Topic 

net1tek
Starting Member

4 Posts

Posted - 2009-07-13 : 05:25:16
Hi there. There is a problem with Windows Update on server 2000 and it downloads old updates repeatedly. Unfortunately these old updates fill up C:\. I need a script to delete these old update folders. The problem is the folder names change each time. They have file names like this: 15b285a7466a7c99db2291dd692a. I did determine there is a specific file in these directories that is found nowhere else on C:. If I have a script that will delete the directory that contains that file I can delete those old update directories automatically with a script. Is there a way to delete every directory that contains a specific file? I have seen plenty of scripts that delete folders based on age or size but not on filename. I know it's a challenge but that's why I'm here. :o) Thanks in advance.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-07-13 : 16:05:29
I think it is dangerous to delete directories this way you are looking for.
Bad things can happen when deleting the wrong folder!?

Do you have tried to find the reason for repeated downloads because that is the real problem?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

net1tek
Starting Member

4 Posts

Posted - 2009-07-14 : 01:32:50
Yes the problem is a Microsoft Windows 2000 problem that will not go away until we upgrade to 2003.
Go to Top of Page
   

- Advertisement -