RM -rf equivalent for Windows?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I need a way to recursively delete a folder and its children, is there a prebuilt tool for this, or do I need to write one? DEL /S doesn't delete directories. DELTREE was removed from Windows 2000+ 回答1: RMDIR or RD if you are using the classic Command Prompt (cmd.exe): rd / s / q "path" If you are using PowerShell you can use Remove-Item (which is aliased to del , erase , rd , ri , rm and rmdir ) and takes a -Recurse argument that can be shorted to -r rd - r "path" 回答2: admin: takeown / r / f folder cacls folder / c / G "ADMINNAME"