Delete Windows Folders

See also Delete Permissions and ACLs from a Folder Recursively

http://windowsitpro.com/article/articleid/84207/jsi-tip-9651-how-can-i-delete-a-folder-that-returns-path-too-long.html

DelFolder.bat

@echo off
if {%1}=={} @echo Syntax: DelFolder FolderPath&goto :EOF
if not exist %1 @echo Syntax: DelFolder FolderPath - %1 NOT found.&goto :EOF
setlocal
set folder=%1
set MT="%TEMP%\DelFolder_%RANDOM%"
MD %MT%
RoboCopy %MT% %folder% /MIR
RD /S /Q %MT%
RD /S /Q %folder%
endlocal