csnyder Posted January 7, 2005 Posted January 7, 2005 I have a situation where I need to clean out student home folders from my CAD class each semester. The user names (Active Directory) never change, but cleaning out over 350 home folders is quite a task when doing them one at a time. There is also one folder (Common) in each parent directory that I need to leave in tact. The structure is multi level:CADHome > Class_1 > UsernameThere are 30 classes with 30 users in each class. Each Class has two folders that are called "Common" and "Transfer" that needs to remain in tact.I have been either cleaning them out manually or re-creating the user accounts, and the home directories, each semester, and that's pain too because of the one folder that needs to remain in each Class parent.Does anyone know of a simple script/program that would accomplish this task starting from the CADHome level, deleting all files and folders from the Username level down, and leaving the "Common" and "Transfer" folder for each Class level, in tact as well as the Class_X and username folder. The transfer needs to be cleaned out as well, but remain under the Class level.When done it should look like this:CADHome Class_1 Common > populated Transfer > clean of files and subfolders User_1 > clean of files and subfolders User_30 " " Class_2 Common Transfer User_1 User_30 Etc.Any help would be much appreciated.Cheers,csnyder
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now