Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.



  • Please log in to reply
3 replies to this topic

#1 ChrisG44


  • Members
  • 2 posts
  • Local time:01:39 PM

Posted 16 August 2013 - 11:37 AM

I'm using SendEmail and windows task scheduler to setup email automation. It works great but I need some custom scripting help. I need to have an email sent daily based on the date. For example I have a file called ETM08-13 and then next month I will have a ETM09-13 etc. I need the script to send the file that corresponds to the current month. I know the changes need to be in the -a parameter. Here is a basic example:

-f xxxxx@gmail.com -u Monday Status Updates -m Here’s the analytics data for this week! -a Analytics_Channel1.csv -txxxxx@yahoo.com -s smtp.gmail.com:587 -xu xxxxx@gmail.com -xp xxxxxxx -o tls=yes

I've contacted the creator of SendMail about this issue and he gave me the linux scrip to do this:

-a filename-`date +%Y-%m-%d`.tar.gz

Any help converting this to a windows script?



BC AdBot (Login to Remove)


#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer

  • Malware Response Team
  • 12,304 posts
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:10:39 AM

Posted 16 August 2013 - 01:00 PM

That depends on 2 Unix shell specific features -- date and backtick expression expansion. I don't think you're going to be able to do this with a batch script -- though with Powershell you should be able to do something similar.

Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#3 ChrisG44

  • Topic Starter

  • Members
  • 2 posts
  • Local time:01:39 PM

Posted 16 August 2013 - 01:12 PM

Thanks for the reply. I have very little powershell experience, any idea where i could find some sample code?


thanks again.

#4 groovicus


  • Security Colleague
  • 9,963 posts
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:39 AM

Posted 16 August 2013 - 09:44 PM

This should help.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users