如何使用Windows命令提示符删除空文件夹? [英] How to delete empty folders using windows command prompt?
本文介绍了如何使用Windows命令提示符删除空文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用Windows命令提示符从我的应用程序文件夹中删除所有空文件夹?
I need to delete all empty folders from my application folder using windows command prompt?
如何创建一个bat文件?
How can I create a bat file like that?
请帮助我。
推荐答案
for /f "usebackq" %%d in (`"dir /ad/b/s | sort /R"`) do rd "%%d"
自: http:// blogs。 msdn.com/b/oldnewthing/archive/2008/04/17/8399914.aspx
当然,首先测试它,而不删除我该命令。此外,这里是来自评论的修改版本,包括具有空格的文件夹:
of course 'd test it first without deleting before i do that command. Also, here's a modded version from the comments that includes folders with spaces:
for /f "usebackq delims=" %%d in (`"dir /ad/b/s | sort /R"`) do rd "%%d"
$ b b p PS在博客文章中有更多的评论可能会帮助你,所以一定要阅读这些,在你尝试之前
P.S. there are more comments in the blog post that might help you out so be sure to read those too before you try this out
这篇关于如何使用Windows命令提示符删除空文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文