To remove viruses from a USB key infected during its adventure with windows, you can proceed in two ways:
1) format the key (you have to disable the autoplay on windows, to do that when you insert the key you hold down the Shift Key)
2) delete the infected files with a Mac.
Usually these files are locked and for that, before dragging them to the trash, you need to remove their protection.
Open the terminal and type:
sudo chflags -R nouchg
Then simply drag the file to unlock in to the terminal:
Press enter and insert your administrator password, now the protection is removed:
The flags add additional levels of control to files that sometimes neither the administrator of the computer can be removed. To change the flag of the files you need to use the command chflags:
chflags — change file flags
chflags [-fhv] [-R [-H | -L | -P]] flags file …
The chflags utility modifies the file flags of the listed files as specified by the flags operand.
The options are as follows:
-R Change the file flags for the file hierarchies rooted in the files instead of just the files themselves.
Putting the letters “no” before or removing the letters “no” from a keyword causes the flag to be cleared.
nouchg clear the user immutable flag (owner or super-user only)