Autoscan an inserted USB stick for viruses

These days computer viruses are spreading mainly through two mediums – the internet (web pages, emails and infected software etc.) and the USB sticks. USB sticks can carry autorun viruses which execute as soon as you insert the USB stick. The infamous Conficker worm, first found in 2009, spreads both through the internet and the USB stick. But do not worry, now you can automatically scan and remove all viruses on a USB stick as soon as it is inserted in your computer. Here is how :

  1. First of all you need a command line virus scanner, so you can give command to scan the USB stick. You can use the command line scan of your own installed antivirus. But in this article we will use the portable and free Emsisoft Commandline Scanner 5.0. You can download the Emsisoft Commandline Scanner 5.0 from After downloading the Emsisoft Commandline Scanner, extract all the contents of the file to a folder like c:a2cmd.
  2. Next, download the USBVirusScan from Extract USBVirusScan.exe from the ZIP file to the same folder (c:a2cmd).

  3. Create a batch file named C:a2cmdgo.bat which contains the following lines :
    @echo offUSBVirusScan.exe "c:a2cmda2cmd.exe" %%d: /h /q /r /n /aexit

  4. Press the keyboard shortcut Windows logo key + R to open the Run dialog. In the Run dialog, type Shell:Startup and press Enter. This will open the Start folder.

    Put a shortcut to the c:a2cmdgo.bat in the Start folder. This can be done by right-clicking c:a2cmdgo.bat and selecting Copy from the context menu. Then right-click in the Start folder and select Paste Shortcut from the context menu.

  5. You are all set. Now restart your computer. Upon restarting you would find the USBVirusScan icon in your system tray (notification area). As soon as, you insert a USB stick, the Emsisoft Commandline scanner starts scanning it for malware. The found malware files are moved to the quarantine folder which is located at C:a2cmdquarantine.

USBVirusScan by Didier Stevens is a nice handy tool which can be used to get rid of viruses and other malware loaded on a USB stick as soon as it is inserted. You can use any antivirus product of your choice to do the scanning. For more information, you can visit the USBVirusScan webpage at

Leave a Reply

Your email address will not be published. Required fields are marked *