Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 07, 2016, 10:13:56 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: Want to send a Batch file - but gmail & prob AV dont...  (Read 7862 times)

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,328
    • View Profile
    • Donate to Member
Want to send a Batch file - but gmail & prob AV dont...
« on: September 24, 2012, 09:28:42 AM »
I want to send a batch file to someone in a corporate environment. I thought I'd send it as a text file but then realised their AV will probably kickup a fuss.
Then I though to just have the 'code' in the body of the email but their AV might pick up on that too (?)  
I dont want to get my email (address) blocked :-\
 
I know that google drive is blocked for them, so probably lots of other sites are too.

So, just wondering if you've any suggestions, or do you think I'd get away with pasting it in email body?

________________________
It's a simple batch file that will create a list of files in the folder the file is in (+ sub-folders).
I patched it together from various sources so it may be 'funny peculiar' - but it works ;-)

Code: Text [Select]
  1. @ echo off
  2. chdir /C %~dp0
  3. dir/o /s >dir.txt
  4. exit
Tom
« Last Edit: September 24, 2012, 09:34:47 AM by tomos »

rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 1,880
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #1 on: September 24, 2012, 09:37:49 AM »
Pastebin or similar likely blocked too?

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,328
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #2 on: September 24, 2012, 09:38:11 AM »
of course,
I can send it as a screenshot :)


Pastebin or similar likely blocked too?

I can always try!
Tom

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #3 on: September 24, 2012, 09:45:10 AM »
I found that sending things like that in a .rar file always seems to slip through. ;-)

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,328
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #4 on: September 24, 2012, 09:53:22 AM »
I found that sending things like that in a .rar file always seems to slip through. ;-)

good idea, but they're on XP so cannot open :(

I was thinking of sending it as PDf but might just go with the screenshot to be on the safe side - more work for him, but it is short anyway (I wanted to keep it simple).
Tom

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #5 on: September 24, 2012, 10:27:51 AM »
good idea, but they're on XP so cannot open :(

7zip  ;)

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,328
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #6 on: September 24, 2012, 10:45:29 AM »
good idea, but they're on XP so cannot open :(

7zip  ;)

I know, but again: corporate environment, I dont want to ask them to 'install' software - even portable. I'm pushing it with the whole batch file thing already.
Put it this way - it's in both our interests if they can get this file list, but it's a much bigger help/priority for me than it is for them. Hence the attempt to keep it simple for them...
Tom

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #7 on: September 24, 2012, 11:08:52 AM »
This is one of the reasons why I like dropbox so much. Instead of having to deal with GMail not allowing executables, not even in zip files, and the possibility that the recipient won't be able to open a rar file, I can send them a link to download the zip instead of attaching it, bypassing the issues with GMail.

If you have access to dropbox on your end (can even upload to it from the website instead of having it installed locally), this might be the easiest way to go about it, now and in the future. Just zip up the batch file and send them a download link in the body of the email.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,328
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #8 on: September 24, 2012, 11:17:46 AM »
That's maybe worth a try - at least my email address wont get in trouble. But I was presuming:

1) their AV will pick up on it
2) dropbox may be blocked anyway

But seeing as I wont get in trouble directly, I'll give it a try :up:
Tom

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,091
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #9 on: September 24, 2012, 11:29:18 AM »
@tomos
I have just mailed the code as simple text-mail, first to my gmail account, and from there back to my Danish account. No problems at all.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,328
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #10 on: September 24, 2012, 11:32:35 AM »
@tomos
I have just mailed the code as simple text-mail, first to my gmail account, and from there back to my Danish account. No problems at all.

sounds good - do you have an AV checking your incoming mails? (makes me realise I could check it that way here too and downloaded mail is checked by AV :up:)
Tom

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #11 on: September 24, 2012, 11:33:05 AM »
1) their AV will pick up on it
2) dropbox may be blocked anyway

1) If their AV will block the download, it's likely it would also eat the .bat file, no matter what method you use to get it to him.
2) A lot of companies don't block dropbox because they use it internally in some of their own departments to exchange files with their offsite employees and independent contractors.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,328
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #12 on: September 24, 2012, 11:35:53 AM »
If their AV will block the download, it's likely it would also eat the .bat file, no matter what method you use to get it to him.

very good point - probably also the case if he creates it himself.
Will report back,
thanks for the brainstorming all :Thmbsup:
Tom

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,099
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #13 on: September 25, 2012, 05:48:06 PM »
You could also try send as plain text but in front of each line of text you put an escape code, like # or -- or REM (for batch).

If there is a parser scanning the content of the attachment, you could likely fool it this way. In essence you just sent text which cannot be ¨executed¨ in any way.

The receiver can easily adjust the script. Most text editors are capable to removing columns in texts nowadays. Even if the receiver is only allowed to use Notepad, this shouldn´t be much of an issue either.

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,606
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #14 on: September 25, 2012, 07:02:45 PM »
I often need to transfer files that are blocked (executables) or are too large to go through the corporate mail system and I've found a couple of tricks that help.  

for executables you can rename the file, eg give it an additional extension, like ABC.EXE.TRASH.  Then advise the recipient to delete the bogus extension before they run the file (they have to save it locally first).  You can also try packing it into a ZIP file, though this isn't always

for overlarge files I use 7Zip ('cos ZIP compression is woeful) and create an SFX archive.  Now this is an executable, and I either pack it into a ZIP file, or add a dummy extension

if that fails, you could always break it up across multiple emails - potentially painful, but a line of text on it's own is pretty innocuous - or munge the code somehow, eg adding whitespaces or substituting ~ for the i character would turn most of it into gibberish, but would be simple for anyone to reverse

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,780
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #15 on: September 26, 2012, 01:28:47 AM »
Passing a script like .bat, .cmd or .sh as an attachment is most easily done by renaming to .txt (or .log), like originally mentioned. Best is to replace the original file extension, and instruct the recipient to save and rename the file. If they don't know how to handle that, then you've probably addressed the wrong person...
Anticipating on what an AV would catch is a waste of time, you won't know until you've tried.

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,606
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #16 on: September 26, 2012, 02:05:36 AM »
do you know the target path?

if so you don't need to send a batch file as one line will do it (sorry if I'm teaching you to suck eggs :-[)

get them to bring up the run dialog (WIN+R), then paste in 'dir C:\folderx\*.* /on /s > c:\folderx\list.txt' and press ok

output to a txt file in the target directory, and it shouldn't trigger the AV

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,550
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #17 on: September 26, 2012, 04:46:20 AM »
I found that sending things like that in a .rar file always seems to slip through. ;-)

good idea, but they're on XP so cannot open :(

I think Chris G's Unzip Snack from here might open rar files! (Too lazy to check, and I'm too senile to remember!)

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,328
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #18 on: September 26, 2012, 07:54:48 AM »
^ thanks Tao, but I dont want to ask them to install anything, even portable soft.

============

@Target,
this is my first ever batch file & I'm pretty chuffed about it :-)
So, I'm happy to learn some more!

get them to bring up the run dialog (WIN+R), then paste in 'dir C:\folderx\*.* /on /s > c:\folderx\list.txt' and press ok

do you mean open a command window first? (the fact I'm not sure there shows you my level of expertise)
Okay, after getting error messages, I opened the command window.
I cant paste into a command window - or can I?
Yes I can ;) learning a lot today :)

and it works :Thmbsup:

I've already sent the guy a dropbox link with the batch file - if that doesnt work I send him this (I do have the folder path).
Thanks!
Tom

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,091
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #19 on: September 26, 2012, 03:51:36 PM »
but is he able to open a command window on XP? I am not able to do it without first installing a link in the right-click context menu. I have no idea how else to do it. Does he?

Computing is so hard if you're stuck with the default Windows only...  :-[

mwb1100

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,522
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #20 on: September 26, 2012, 04:27:24 PM »
I thought I'd send it as a text file but then realised their AV will probably kickup a fuss.

Have you actually tried renaming the file to whatever.txt then asking the recipient to rename it back to whatever.bat or whatever.cmd?

In my experience, I've found that this makes gmail happy, and I'd be surprised if any AV had a problem, either.

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,606
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #21 on: September 26, 2012, 06:10:27 PM »
but is he able to open a command window on XP? I am not able to do it without first installing a link in the right-click context menu. I have no idea how else to do it. Does he?

Computing is so hard if you're stuck with the default Windows only...  :-[


you can get to the prompt by running cmd.exe from the windows run menu option. 

I suspect you should also be able to concatenate the commands, eg cmd.exe dir etc, but I'm not sure how.  Some of the command line mavens here should be able to answer, failing that google should get you the answer

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,328
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #22 on: September 27, 2012, 02:18:19 AM »
Re the command window
-
I just typed:
Win+R
then:
cmd

Will that not work for everyone?
Tom

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #23 on: September 27, 2012, 05:32:28 AM »
Re the command window
-
I just typed:
Win+R
then:
cmd

Will that not work for everyone?

There really is no need to go that far. Just hit Win+R and type the one line command in the box, and click OK.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,328
    • View Profile
    • Donate to Member
Re: Want to send a Batch file - but gmail & prob AV dont...
« Reply #24 on: September 27, 2012, 05:52:43 AM »
Re the command window
-
I just typed:
Win+R
then:
cmd

Will that not work for everyone?

There really is no need to go that far. Just hit Win+R and type the one line command in the box, and click OK.

I had to go that far, because I kept getting an error message in Win XP & Win7
[windows cant find 'dir' ...] when using Target's suggestion anyways:

dir C:\folderx\*.* /on /s > c:\folderx\list.txt

it worked fine in the command window
Tom