I plugged the USB drive on a public computer at my university and all the files became .exe
Is there a way to clean it without risking that it will copy the virus as soon as I insert the thing?
I plugged the USB drive on a public computer at my university and all the files became .exe
Is there a way to clean it without risking that it will copy the virus as soon as I insert the thing?
If the malware are just .exe files waiting to be clicked on, then not opening them should be enough (also beware of Autorun). You can further protect yourself by using an OS which won't be able to execute the files anyway (like Mac or Linux). Deleting the malicious files or formatting the drive is enough to clean it.
If the malware also modified the files or some filesystem data to be malicious and exploit a vulnerability, you should decide whether you're likely to be affected - if your system is up to date and it's unlikely someone would use a zero-day on you, then it's safe. Otherwise, it's not and you shouldn't be mounting the filesystem (Windows and Mac mount them by default so be careful). Reformatting the drive is again enough to clean it.
If the malware modified the firmware of the USB drive itself, then it's no longer an USB "drive" and will often pretend to be a keyboard and type in malicious commands. At this point, I suggest you just throw away the drive as it is now comparable to a compromised machine and you can no longer trust it.