How to send a batch file by email

35,524

Solution 1

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.

Solution 2

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.

Solution 3

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).

Solution 4

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

Solution 5

The best way to to this is to zip it first (or any compression program). Lost of email providers do not allow sending files which can be run (.exe or .bat for example). Zipping it typically get's round it.

If it still fails, rename the file with .exeXXX (include the xxx) and provide instructions to the recipient that they will have to rename the file before executing on remote machine.

In your case, rename it to .batXXX

Share:
35,524

Related videos on Youtube

MikeFHay
Author by

MikeFHay

Updated on September 18, 2022

Comments

  • MikeFHay
    MikeFHay almost 2 years

    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?

  • Thalys
    Thalys almost 12 years
    He dosen't want to rename it tho. This is a slightly annoying constraint.
  • MikeFHay
    MikeFHay almost 12 years
    Ah, good idea. Telling people to open the file in winzip should be an easy enough instruction. This is a possible solution.
  • MikeFHay
    MikeFHay almost 12 years
    Yes, I think I will have to rethink my approach. These are good ideas, thank you.
  • MikeFHay
    MikeFHay almost 12 years
    Yes, my users are not all very technically-literate, so I would rather have a file they can simply double-click on and let it run. Obviously that would defeat the whole purpose of this security measure, so I'm doubtful that there is a solution. I may have to re-think my approach.
  • Dave
    Dave almost 12 years
    Actually, if you do allow staff to run a .bat or .exe, it would allow any staff to run anything like this (virus anyone?) - yes, it is a security risk and one I would advise to proceed cautiously.
  • ale
    ale almost 12 years
    Wouldn't it be easier to just tell them to remove the .txt extension? All this zipping and double-zipping is a lot of work on both ends just to send a text file with a .bat extension.
  • MikeFHay
    MikeFHay almost 12 years
    @Al Renaming the file means first saving it, then renaming it, then running it. Three steps to achieve something which should be trivial. Not to mention that Windows by default doesn't show file extensions, and gives a warning when extensions are changed. For technically-illiterate users, it is far from ideal.
  • ale
    ale almost 12 years
    And that's more difficult than save the zip file, rename it to *.zip, unzip it?
  • MikeFHay
    MikeFHay almost 12 years
    @Al No, renaming the zip would be too much. This answer is only good enough if the "Open with" dialogue lets them open a .zipfoo file in Windows Explorer. Unfortunately that doesn't appear to be the case.
  • MikeFHay
    MikeFHay almost 12 years
    This is excellent, but requires that the recipient be able to open two different archive formats. As far as I'm aware, Windows only supports Zip out of the box, so they would need 7zip or Winrar or something installed.