Virus Removal Groovy Script

[ This Blog Was Moved To : ]

As I’m a Linux User since years ago. I faced the problem of NO Viruses at my PC, but tons of viruses on my Flash Memory ( USB Stick ), due to copying files to/from windows machines.

Actually, I was never affected by these viruses on my own, but I do NOT want to be a transportation facility for the virus to spread across other machines.

I noticed that there are two simple types of viruses that usually get attached to the memory stick.

  1. A .inf file and a .exe file that ofcourse got a strange name that I can visually detect and manually remove at linux.
  2. A .exe file gets the name of the super directory with the addition of the extension .exe. Which was usually easy to detect visually but hard to remove manually due to the amount of folders on the memory.

So, to fasten the process of  removing the second virus, I wrote this simple Groovy script ( which is in fact a reflection of  an old Java program that I created for the same virus years ago )

// Searchs for the .exe Virus that has the same name of its parent directory
checkVirus = { folder ->
    folder.eachFile{ file ->
        }else if ("${}.exe" == ){
checkVirus (new File('/media/disk/'))

And this is it. Any enhancements or suggestions will be great.