Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a folder, "myFolder". In "myFolder", I have many subfolders.

I know that if the subfolder is less than 10MB, it can be deleted.

Instead of checking the folder step by step, how can I write a batch job to help me delete just the folders?

share|improve this question
Yes, but surely you wish to delete files inside the folders as well. For all folders, by themselves, are smaller than 10mb. –  ldigas May 27 '10 at 2:19
yes, I mean....in "myFolder", there have many sub folders , and files. ONLY the files in the sub folders can be deleted. outside the sub folder, and inside the myFolder that can not be deleted. thz. –  user28167 May 27 '10 at 2:22
This is really a message which belongs at stack overflow. The closest I could find was stackoverflow.com/questions/759481/… which at least gives you the directory size but has to scan each folder which is incredibly slow. You should use a scripting language. –  Daisetsu May 27 '10 at 3:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.