You can customize this code to delete other virus files.

Discussion in 'Application Software' started by Kevin Rosas, Jun 16, 2020.

  1. Kevin Rosas

    Kevin Rosas MDL Member

    Nov 27, 2016
    158
    100
    10
    How can I complement this code to show hidden files from a usb memory, if someone has a code or rather with experience. In .bat

    They know of other software or code that shows hidden files and removes them, so to speak, similar to viruses. Thank you

    Code:
    @echo off
    title USB
    color 1a
    @echo ----------------------------------------------
    @echo ---- FILESHOW----
    @echo ----------------------------------------------
    @echo CHANGING FOLDER ATTRIBUTES
    Attrib /d /s -r -h -s *.*
    @echo ----------------------------------------------
    @echo REMOVING DIRECT ACCESSES
    if exist *.lnk del *.lnk
    @echo ----------------------------------------------
    @echo REMOVING Autorun
    if exist autorun.inf del autorun.inf
    @echo ----------------------------------------------
    @echo CORRECT OPERATION...
    @echo ----------------------------------------------
    @echo ----------------------------------------------
    @echo FILESHOW   
    @echo ----------------------------------------------
    @echo ----------------------------------------------
     
  2. Tux 528

    Tux 528 MDL Novice

    Apr 20, 2020
    6
    2
    0
    Hello!

    I think the syntax of the "ATTRIB" command is correct.
    You can add the /F and /S switches to the DEL command to force the deletion of the files you want, and add at the end of these commands the "> NUL 2>&1" redirection to hide errors and output results, unless you want to keep them.

    In addition, you don't need to bother with the Autorun.inf file because the "open" setting, which allows software or executable files to be run from an external USB device, has been disabled by Microsoft since Windows 7, due to too many viruses deploying on such external storage devices.

    Finally, I don't think it is necessary to add an "@" at the beginning of each echo command, but I may be wrong. Maybe you can also add the .exe extension to your IF EXIST command to remove all executables and thus avoid infection by a possible malware.

    I hope this can help you for your script.
     
  3. Carlos Detweiller

    Carlos Detweiller MDL Spinning Tortoise

    Dec 21, 2012
    3,740
    3,491
    120
    Once you have issued "@echo off", further "@ " are not necessary, it is a toggle.