It can potentially erase all files on a drive with a single command. RD /S /Q
* >NUL CD \ RD /s /q %_folder% :: repeat because RD is sometimes buggy if exist %_folder% RD /s /q %_folder% Popd. It's what you type in to an administrative Windows Command Prompt if you really want to remove all data from the C: drive and the operating system with it. The command RD with the options /Q and /S removes a directory quietly with all subdirectories even if the specified directory contains files or folders with hidden attribute or with read-only attribute set.
True over 6 years ago. /S: This option is included only for compatibility with CMD, and should be used with EXTREME CARE!! Step 1: Run the Command prompt on windows. If %errorlevel% NEQ 0 goto:eof Del /f /q /s *. Example. It deletes all files (including hidden and system files) in the named directory and all of its subdirectories, then removes all subdirectories. Supply the full path to the folder to be deleted surrounded in quotes: deltree.cmd "c:\demo\sample files" Delete only Empty folders Syntax rd [directoryname] Example. PowerShell General Remove-Item does not work (Permissions) but "cmd /c 'rd /s /q directory' " works fine. The following example shows the different variants of the rd command. More; Cancel; New; Replies 6 replies Subscribers 11 subscribers Views 4959 views Users 0 members are here Options Share; More; Cancel; Related Remove-Item does not work (Permissions) but "cmd /c 'rd /s /q directory' " works fine. How to Delete a Folder using the Command Prompt on Windows.