-1

How can I clean a USB flash drive from infections safely without losing files/documents inside?

When I connect USB drives, there are shortcuts, exe files and hidden files, so I want to make un-hidden, cleaned from viruses and safe docs and files too.

NoMAD
  • 49

1 Answers1

-1

Here is handy batch file I wrote to rid USB drives of common infections. Launch the command prompt as administrator, navigate to the root of the USB drive and copy the batch file there. And run it.

@echo off
color 7c
echo .
echo .
echo .
echo Cleaning Drive...............
echo .
echo .
echo 1. Deleting autorun files...........
del /a /f "autorun"
del /a /f "autorun.inf"
echo .
echo .
echo 2. Removing New Folder.exe virus..........
del /a /s "* .exe"
del /a /s regsvr.exe
echo .
echo .
echo 3. Removing Screen Saver virus........
del /a /s "*.scr"
echo .
echo .
echo 4. Removing Recycler virus (Press Y if asked)..........
del /a /s /f Recycler

echo .
echo .
echo 5. Removing Unnecessary Shortcuts and desktop_1.ini files..........
del /a  /f /s "*.lnk"
del /a /s /f "Desktop_1.ini"
echo .
echo .
echo 6. Un-hiding original folders.......
attrib /s /d * -h -s
echo .
echo ======== Drive cleaned Successfully=========
echo .
echo .
echo .
choice /T 3 /D y /N /M "The disinfection batch will auto-terminate in 3 seconds"

This is not a fool-proof solution and I still recommend scanning the drive with a good antivirus.

tumchaaditya
  • 3,752
  • 5
  • 41
  • 58