Disconnect the pendrive from the computer
Scan the pendrive with updated antivirus software
Quarantine or delete detected infected files
Enable showing hidden files and folders
Open Command Prompt as administrator
Run `attrib -h -r -s /s /d X:*.*` replacing `X` with the pendrive drive letter
Delete suspicious shortcut files, autorun files, and unknown executables
Check and remove hidden folders and files manually
Format the pendrive if infection remains
Restore clean files from a backup
Scan the computer used with the pendrive to prevent reinfection
Keep antivirus and operating system updated
Avoid opening unknown files from the pendrive
