http://www.howtogeek.com/234683/why-you ... o-instead/
sdel.bat Most recent version
Code: Select all
@echo off
title SDEL - speedy deltetion
:again
cls
echo SDEL - Speedy delete program
echo.
echo F - Delete only one file
echo D - Delete all files in this directory (folder)
echo E - Exit this batch
echo.
set /p o=Please select a option:
if /i %o%==F goto file
if /i %o%==D goto folder
if /i %o%==E goto x
goto again
rem Delete only one file
:file
set /p f=Enter path of file including extension:
If exist %f% goto del else goto f && echo path invalid
:del
set file=%f%
FOR /f %%i IN ("%file%") DO (
set filepath=%%~pi
)
cd /d %filepath%
type nul> %f%
ren %f% sdel%random%.sdel
del *.sdel
goto x
rem Delete all files in this directory (folder)
:folder
set /p d=enter path of folder to delete:
cd /d %d%
for %%a in (*.*) do type nul > %%a
for %%a in (*.*) do ren sdel%random%.sdel %%a
for %%a in (*.*) do del *.sdel %%a
goto :x
rem Exit this batch
:x
echo coded by Batchcc
:: Special thanks to Trebor68 for helping.
:: http://www.dostips.com/forum/viewtopic.php?p=43862#p43862
:: this file may be redistributed but do NOT remove the credits.
echo deletion complete...
pause