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