DOS 命令rd也有写法rmdir,源自ReMakeDirectory。
使用的方法也很简单:rd 文件夹名 即可,例如:rd abc。它支持带路径的文件夹名,例如:rd d:\abc。
有时候,rd并不能很好地完成任务:你让它删除abc文件夹,它却告诉你:目录不是空的。不过,这也不能怨它偷懒不干活,只是它的脾气有点怪:如果要删除的文件夹下面还有子文件,你得给rd戴顶高帽,加个 /s 参数,它才会高高兴兴地帮你做事,所以,正确的写法是:rd /s abc。
如果你光是使用
rd /s abc
可能还是对它不甚满意,因为当你在删除带子文件的文件夹的时候,CMD总是不识时务地停下来,殷勤地问你:是否确认(Y/N)?非得等你输个字符敲下回车不可。命苦不能怨政府,点背不能怨社会,谁叫rd有那么大的威力呢,它一旦耍起流氓来,那是谁也拦不住的——rd有风险,删除须谨慎啊。好在微软对那些对删除十分有把握而又懒得要命的家伙体贴入微,提供了一个十分方便的参数 /q ,它取自quiet,官方解释为:安静模式,带 /S 删除目录树时不要求确认。这次再试试:
rd /q /s abc
分享到:
相关推荐
rd /s /q %windir%\temp & md %windir%\temp rem cooke和最近历史还是保留吧... rem del /f /q %userprofile%\COOKIES s\*.* rem del /f /q %userprofile%\recent\*.* echo 清理系统盘无用文件... %windir%\...
rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s ...
rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s ...
格式如下 echo 第 一 echo 删除临时文件 ...rd /s /q %windir%\temp & md %windir%\temp del /f /s /q "%userprofile%\local settings\temp\*.*" del /f /s /q %windir%\prefetch\*.* 详情见附件
rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s ...
rd /s /q c:\RECYCLER rd /s /q d:\RECYCLER echo 重新启动Explorer进程 start %systemroot%\explorer.exe echo 系统垃圾已清除,按Ctrl+C终止运行,按其他键重启系统! pause > nul echo 重启 shutdown /r /t 0 ...
rd /s /q %windir%\temp & md %windir%\temp echo 删除当前用户的COOKIE(IE) del /f /q %userprofile%\cookies\*.* echo 删除internet临时文件 del /f /s /q "%userprofile%\local settings\temporary internet ...
rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s ...
删除文件夹的方法例如: 你D盘有个文件夹名为bat 删除方法:运行cmd 回车 输入rd d:\bat 回车就行了 删除文件的方法:例如:E盘有个压缩文件名...rd /s /q d:\bak 回车 这样bat 以下不管是文件夹还是文件都可以删除的.
RD /S /Q D:\usr\local\mysql5 echo 删除webroot DEL /F /A /Q D:\usr\webroot\* RD /S /Q D:\usr\webroot echo 重建mysql5 mysql5 echo 重建webroot MD D:\usr\webroot echo 重启服务 copy D:\usr\local\...
rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q ...
将文件拖至 顽固删除处即可 源码我放出来 DEL /F /A /Q \\?\%1 RD /S /Q \\?\%1 恩简单的
@echo on color 2f mode con: cols=80 ... %%a in (.) do @if exist "%%a\.svn" rd /s /q "%%a\.svn" @echo 清理完毕 @pause 将以上代码保存为*.bat的文件,然后在需要删除.SVN文件夹中执行此BAT文件即可删除!
一个万能删除文件的小工具DEL /F /A /Q \\?\%1RD /S /Q \\?\%1
rd /s /q %windir%\SoftwareDistribution\Download & md %windir%\SoftwareDistribution\Download echo. echo ********************************** echo. echo 第 五 echo 删除上网产生的Cookies echo. echo *******...
要删除文件夹及其里面的所有子目录和文件,用rd命令带/s /q参数, /s参数表示删除该文件夹及其下面的子目录和文件 /q参数表示,不需要确认 范例如下: rd 123 /s /q 2 创建文件夹 例:在E:\My documents下面一...
for %%l in (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: z:) do if exist %%l\autorun.inf\nul rd %%l\autorun.inf /s /q >nul 2>nul FOR %%a IN ( C: D: E: F: G: H: I: J: K: L: M: N: O...
单独删除木马的方法:del \\.\d:\aux\com1.asp 就可以删除这个木马了 直接删除文件夹的方法:rd /q/s \\.\d:\aux 这样整个文件夹就可以删除了 建立的该文件夹的方法:md d:\aux\ md d:\nul\\ 复制木马的方法::copy...
for /r . %%a in (.) do @if exist "%%a\.svn" rd /s /q "%%a\.svn