Scripts Thread, Help! A script to find and delete folders and contents in Coding and Web Development; Hi All,
Luckily for me I am on a training course all next week which leaves the school with no ...
20th March 2009, 10:06 AM #1
Help! A script to find and delete folders and contents
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?
20th March 2009, 10:24 AM #2
could try a simple batch file that has something like
del filename.txt /s /f
Originally Posted by reggiep
20th March 2009, 10:26 AM #3
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?
20th March 2009, 10:39 AM #4
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.
20th March 2009, 11:15 AM #5
Not quite right yet for me, probably me doing something wrong.
Originally Posted by OutToLunch
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!
By RabbieBurns in forum Scripts
Last Post: 9th February 2009, 11:16 AM
By scotimus in forum Scripts
Last Post: 26th September 2008, 04:57 PM
By Baasha_Bhai in forum Scripts
Last Post: 2nd July 2008, 11:41 AM
Last Post: 4th June 2008, 01:30 PM
By Pumaedition in forum Scripts
Last Post: 22nd April 2008, 11:08 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)