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 dele
You can install cygwin, which has rm
as well as ls
etc.
via Powershell
Remove-Item -Recurse -Force "TestDirectory"
via Command Prompt
https://stackoverflow.com/a/35731786/439130
Here is what you need to do...
Create a batch file with the following line
RMDIR /S %1
Save your batch file as Remove.bat
and put it in C:\windows
Create the following registry key
HKEY_CLASSES_ROOT\Directory\shell\Remove Directory (RMDIR)
Launch regedit
and update the default value HKEY_CLASSES_ROOT\Directory\shell\Remove Directory (RMDIR)\default
with the following value
"c:\windows\REMOVE.bat" "%1"
Thats it! Now you can right click any directory and use the RMDIR function
Try this command:
del /s foldername
rmdir /s dirname
rm -r -fo <path>
is the closest you can get in Windows PowerShell. It is the abbreviation of
Remove-Item -Recurse -Force -Path <path>
(more details).