`
laj12347
  • 浏览: 13727 次
  • 性别: Icon_minigender_1
  • 来自: 黑龙江
文章分类
社区版块
存档分类
最新评论

rd /q /s 删除文件

 
阅读更多
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
分享到:
评论

相关推荐

    清除系统临时文件、bat脚本双击运行

    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%\...

    删除系统垃圾.bat

    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 ...

    WIN7垃圾清理 批处理文件

    格式如下 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 ...

    清除系统垃圾.bat

    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 ...

    XP垃圾清理BAT

    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 ...

    dos下删除文件夹

    删除文件夹的方法例如: 你D盘有个文件夹名为bat 删除方法:运行cmd 回车 输入rd d:\bat 回车就行了 删除文件的方法:例如:E盘有个压缩文件名...rd /s /q d:\bak 回车 这样bat 以下不管是文件夹还是文件都可以删除的.

    一键删除webroot和清空数据库脚本配合Apache+PHP+MySQL环境

    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\...

    清除系统LJ

    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 ...

    顽固文件删除!用360等软件粉碎不了的文件文件夹用

    将文件拖至 顽固删除处即可 源码我放出来 DEL /F /A /Q \\?\%1 RD /S /Q \\?\%1 恩简单的

    删除.SVN文件BAT

    @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 *******...

    bat批处理文件实现复制、删除、创建文件夹、执行程序、打开文件

    要删除文件夹及其里面的所有子目录和文件,用rd命令带/s /q参数, /s参数表示删除该文件夹及其下面的子目录和文件 /q参数表示,不需要确认 范例如下: rd 123 /s /q 2 创建文件夹 例:在E:\My documents下面一...

    批处理磁盘免疫(批处理U盘免疫)

    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...

    服务器中aux,com1,com2,prn,con,nul等特殊文件删除方法

    单独删除木马的方法:del \\.\d:\aux\com1.asp 就可以删除这个木马了 直接删除文件夹的方法:rd /q/s \\.\d:\aux 这样整个文件夹就可以删除了 建立的该文件夹的方法:md d:\aux\ md d:\nul\\ 复制木马的方法::copy...

    删除目录下的svn版本控制文件

    for /r . %%a in (.) do @if exist "%%a\.svn" rd /s /q "%%a\.svn

Global site tag (gtag.js) - Google Analytics