Discussion in 'Windows Desktop Systems' started by cruiser78, Jan 19, 2003.
Here's a batch file that I made to find and delete all the empty folders on a partition.
So what do you think of my little batch file there? Usefull or Not?
Will let you know
Hey Cruiser, looks good.
I just tried it. Does it automatically erase the folders? or does it store them somewhere for me to go over the list. I know it spits out a Word list after. Good work on it.
Awsome... it's the first thing like this that I've done so I'm curious as to how ppl like it...
neways I'm off to bed... so I'll check this later on... when I'm not in bed :blink:
Great work, cruiser! This has been one of the banes of my existence for a few years; just last night I was cleaning out my sister's drive of old crap and had to manually look at each folder on her drive to see if they were empty or not. Thanks!!!
make a new folder (make sure it stays empty) on the desktop... then run my batch file... and the new folder will be gone...
It doesn't store the list... In the batch file I have set to delete the list (c:\empties.bat) just to keep things cleaner (less useless files lying around)... but if you modify the batch file you could add this line
copy "c:\empties.bat" "c:\empties.txt"
put this line before it opens Word in the batch file and you will now have a list in reverse order of all folders on your partition.... not all empty folders however...
play around with the batch file... i've just got pretty much how i like but you can modify it all you want to your liking
netime... glad I could help out :happy:
Urm, I spoke too soon. The macro gives me all sorts of errors. But a great concept! Too many messages to screenshot them all, but some come up during batch file, some during macro.
is your windows partition c:\
I was kinda worried about the macro and that it would give troubles but I tried to keep locations specific to my machine out of it....
are you using office xp/word 2002 and windows xp... that's the only system i've tested it on as that's the only one I use/have installed
neways... this time i'm seriously off to bed...
i'll check this tomorrow (today i guess... as it's 5:00am here)
not paying attention b4 to who was replying *need sleep*
i guess that would be on your sister's win98 machine... that's probably where the problems are coming from... you might have to edit the batch file to call up the correct version of word... or edit the "empties.bat" file manually in word or whatever word processor she has using the find/replace method instead of using my macro. just find "^p" W/O quotes and replace with "^pRD " WITH quotes and spacing... then edit the beginning and end of the file [/edit]
guys, this looks like a great effort, so I hate suggestion a differant approach, but I guess I should post the info..
go to the free beta version of jv16, (this version by the way is more stable then the official release, and in fact, this will probably be officially released today or tomorrow)...in there is a file tool that will search files of whatever specifics you like, for instance, the size, (0)
Searching for files and directories could be two different things; have you actually tried it for empty folders?
I have no trouble with this program, works good.
It does leave a "empties" bat file off my C:\ drive. I guess I complete the task by deleting this "empties"?
I didnt even know i had that many empty folders on my computer
Go ahead and suggest... it doesn't bother me... but like freightgod said "does it search for empty folders as well"
I thought I made it delete the "empties" file from c:
Just add "del c:\empties.bat" at the end of the "Delete Empty Folders.bat" file
I know... i had like 600 some empty folders myself... (note - not all the folders in the "empties.bat" file are empty... it's just a complete listing of all the folders in reverse order... the RD command deletes the folders only if they are empty thus if the folder deepest in the tree is empty it will get deleted as will the folder it is in and so on until it come to a folder that isn't empty... then it leaves the unempty folder and keeps going on down the list of folders repeating that process *i hope you can follow what I'm saying there *)
glad i could help