目录不是空的错误 [英] directory is not empty error

查看:127
本文介绍了目录不是空的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着在我的批处理文件Ø有许多文件和子目录删除文件夹(BR),我尝试以下方法:

(如果存在)C:\\ BR(
命令rmdirC:\\ BR/ S / Q

但有时我得到一个错误,一个特定的文件夹不是empty.these文件夹中包含的CSS文件。
什么问题?


解决方案

  RD / S / Q DIRNAME
命令rmdir / S / Q DIRNAME

这是不能删除的文件正在使用中。结果
关闭任何程序持有通畅,可能是你的浏览器,然后重试。

让我猜猜,你试图删除%TMP%文件夹中。



编辑::要回答紫皮的问题。

这将删除所有文件和文件夹,它可以。所以,如果 C:\\ tmp目录\\ DIR2 \\ DIR3 \\ open.txt 是开放的, C:\\ tmp目录\\ emptyDir 是一个空目录,你这样做:

  C:\\> DIR C:\\ tmp目录/ B / S
C:\\ tmp目录\\ A.TXT
C:\\ tmp目录\\ DIR2 \\ b.txt
C:\\ tmp目录\\ DIR2 \\ DIR3 \\ open.txtC:\\> RD / Q / s的C:\\ tmp目录C:\\> DIR / S / B为C:\\ tmp目录
C:\\ tmp目录\\ DIR2 \\ DIR3 \\ open.txt

您已经删除了:

  C:\\ tmp目录\\ A.TXT
C:\\ tmp目录\\ DIR2 \\ b.txt

和删除:

  C:\\ tmp目录\\ emptyDir

但仍然有目录...

  C:\\ tmp目录
C:\\ tmp目录\\ DIR2
C:\\ tmp目录\\ DIR2 \\ DIR3

...一个文件:

  C:\\ tmp目录\\ DIR2 \\ DIR3 \\ open.txt

如果不是, A.TXT 是开着的,你只需要:

  C:\\ tmp目录\\

  C:\\ tmp目录\\ A.TXT

I try in my batch file o delete folder(BR) with many files and subdirectories, I try the following:

if exist C:\BR ( rmdir "C:\BR" /S /q )

but sometimes I get an error that a specific folder is not empty.these folder contains files of CSS. what the problem??

解决方案

rd /s /q DIRNAME
rmdir /s /q DIRNAME

The files that you can't delete are in use.
Close whatever program is holding them open, probably your browser, and try again.

Let me guess, your trying to delete your %TMP% folder.



EDIT: To answer zipi's question.

It will delete every file and folder that it can. So, if c:\tmp\dir2\dir3\open.txt is open, c:\tmp\emptyDir is an empty directory, and you do this:

c:\>dir c:\tmp /b /s
c:\tmp\a.txt
c:\tmp\dir2\b.txt
c:\tmp\dir2\dir3\open.txt

c:\>rd /q /s c:\tmp

c:\>dir /s /b c:\tmp
c:\tmp\dir2\dir3\open.txt

You will have deleted:

c:\tmp\a.txt
c:\tmp\dir2\b.txt

And removed:

c:\tmp\emptyDir

But still have the directories...

c:\tmp
c:\tmp\dir2
c:\tmp\dir2\dir3

...an the file:

c:\tmp\dir2\dir3\open.txt

If instead, a.txt was open, you'd only have:

c:\tmp\

and

c:\tmp\a.txt

这篇关于目录不是空的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆