I want to make a .bat file that deletes known viruses and worms in the system32 file
Just so you are aware, there is more to malware removal than just deleting some files. There are also often registry keys, etc that go along with it. Still, I suppose it is possible, just not a very efficient way to go about it.
I have no idea what operating system you are running, but the Windows folder is a protected folder. Any read-writes that take place have to be done by processes with administrative rights. Just because you have admin rights does not mean that the file you created does. A couple things to think about. What happens if there is a problem with your file and you do actually get it to run? You could accidentally brick your system. Another thing is messing around with permissions is a god way to open your system up in ways you can never imagine. I say that because if you are trying to go about removing malware with .bat files, then you don't exactly understand the environment in which you are trying to work.
If you are going to go about doing this, set up a virtual machine on your system and work with that. If you wreck that, you can easily restore an image. Not so much if you brick your entire computer.
Your anti-virus is behaving exactly as it should. It is letting you know that an unauthorized file is trying to do file manipulation in a place where it has no business doing so. I am not sure if AVG has a setting to ignore certain fies or not.