DELTREE - Windows 95 Command


Previous versions of Windows had the DELTREE command that deletes all files and sub folders.

DEL /s will delete all files
RD /s will remove all files and folders including the root folder.

:: Remove all files and subfolders but NOT the root folder
:: From tip 617 at
@echo off
pushd %1
del /q *.* 
for /f "Tokens=*" %%G in ('dir /B') do rd /s /q "%%G"

“Everyone has a strategy until they get punched in the face” ~ Mike Tyson


RD - Delete folders or entire folder trees
DELPROF Delete NT user profiles
DEL - Delete files
PowerShell: Remove-Item - Delete the specified items.
Equivalent bash command (Linux): rmdir / rm - Remove folders/ files

© Copyright 1999-2015
Some rights reserved