Solved

Deleteing Empty subfolders with a Batch File

Posted on 2008-10-21
2
423 Views
Last Modified: 2010-04-21
Is there a simple way to use a batch file to delete an empty subfolder? I can delete all of the contents within a folder but I can't seem to delete the leftover empty folder.
0
Comment
Question by:Joseph Moody
2 Comments
 
LVL 20

Accepted Solution

by:
edster9999 earned 500 total points
ID: 22770792
There used to be a nice command in DOS called deltree
But it was removed a few years ago.

the code was put into rmdir
if you use the /s and /q

This will then delete a full directory and all its contents and then the directory itself.

You might need to put double quotes round the dir name or the variable you are using if the directory name (or parent ones) have spaces in them.
0
 
LVL 22

Author Closing Comment

by:Joseph Moody
ID: 31508466
Thanks! I learn something new everyday!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now