How to send a batch file by email

Trying to send a batch file as an email attachment, I get the following error:

mx.google.com rejected your message to the following e-mail addresses:

[email protected]

mx.google.com gave this error: Our system detected an illegal attachment on your message. Please visit http://support.google.com/mail/bin/answer.py?answer=6590 to review our attachment guidelines. q42si10198525wei.6

Your message wasn't delivered because the recipient's e-mail provider rejected it.

This also happens if I place the batch file in a .zip archive. I need to send a batch file to everyone at my company for them to run, preferably without having to change file extensions first. Is this possible by email?


Its a 'security' thing, and in this case, changing the extension is the easiest way to fix it. I did a few tests before and gmail at the very least checks 7zip, and zip files.

You need everyone in the company to run it - use a fileshare and share the link to it internally. You might also be able to upload it somewhere and get the link to the others. In this case getting creative is the best idea.


I have done it by simply double-zipping it, because Gmail does not unzip and checks recursively.

Archive it in .rar format, then .zip, or .tar.gz, or any other combination of two different archiving formats.

However, it may be a bit of work for some of your recipients to un-archive twice, so the other answers may prove more useful.


I don't know of any way you can do it without changing the file extension. The way I usually send .exe or any type of executables through email is by first zipping it, then changin the extension of the zip file (to something made up).


Put it in a password-protected zip file and include the password in the body of the email.