-1

This question already has an answer here:

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.

marked as duplicate by Scott, fixer1234, Pimp Juice IT, Twisty Impersonator, Ramhound May 7 '17 at 2:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

-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.

  • PS: This batch file is partly sourced from internet and I don't claim all the credit for this. I made a few amendments and additions. – tumchaaditya Aug 19 '14 at 14:22
  • Thanks for answer to my question friend. at first i have to navigate to my root on CMD for example: H: and should paste ur given batch file into there all right? – VEGA Aug 19 '14 at 14:49
  • Don't paste it there. First create a batch file by pasting my code above using notepad or something, copy it over to root of USB drive and then run the batch file from command prompt. – tumchaaditya Aug 19 '14 at 14:50
  • Thanks. That script helped me much. – VEGA Nov 5 '18 at 17:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.