Luckily for me I am on a training course all next week which leaves the school with no tech support as my workmate is off long term sick.
Unluckily we are running low on server HD space so until my new drives arrive I need an emergency script to help me out.
What i need is a script that will search through the users on the h: drive to look for folders with certain names
e.g. "microsoft user data" which is created when a user logs on to a mac adding 20 meg to their folder, which they can do without once they log off agian for the short term!
I have looked through the scripts already on here but I can't find one that will search through sub directories to find a particular folder and then delete it.
Could somebody please help?
I need to delete folders!
It needs to search and find those folders and then delete them.
I don't think that script would do that?
If you know the folder is always in the same place it's relatively simple to walk through the tree structure removing only that folder - I use it to keep our roaming profiles tidy by removing folders created when students play a game etc.
For /D %%I in (*) DO RD /S /Q "%%I\Microsoft User Data"
when run in a .bat from the top level of the share/folder structure. I'd normally run it on the server rather than a share just in case anything misbehaves, and as with any automated delete, test it on a dummy folder structure first. It doesn't need to search as any homedirs not containing the MUD folder it will simply continue the loop.
I need the batch file to go through the h: drive and then find the folder "microsoft user data"...
And then delete it!
It could be in a different area on different users drives.
I am trying to use edusweeo at the moment to automate this but i don't think it deletes folders?
Thanks for th help so far!
There are currently 1 users browsing this thread. (0 members and 1 guests)