"rm -rf" equivalent for Windows?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

"rm -rf" equivalent for Windows?

Message par ForumBot »

"rm -rf" equivalent for Windows?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: "rm -rf" equivalent for Windows?

Message par ForumBot »

RMDIR or RD if you are using the classic Command Prompt (cmd.exe):

```
rd /s /q "path"

```


RMDIR [/S] [/Q] [drive:]path



RD [/S] [/Q] [drive:]path



/S Removes all directories and files in the specified directory in addition to the directory itself. **Used to remove a directory tree.**



/Q Quiet mode, do not ask if ok to remove a directory tree with /S

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"

```
Répondre

Revenir à « Performance & Dépannage »