DELTREE - Windows 95 Command

DELTREE

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 JsiFAQ.com
@echo off
pushd %1
del /q *.* 
for /f "Tokens=*" %%G in ('dir /B') do rd /s /q "%%G"
popd 

“It devoured my paper, it was a really good paper” ~ Ellen Feiss

Related:

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 SS64.com 1999-2013
Some rights reserved