Email Confirmation from a batch file running

Posted on 2011-04-29
Last Modified: 2012-06-21
I'm looking for the most effective way to either send an email confirmation back to me after a temp file delete batch file runs. We have it now so that the batch file creates a log in the event viewer as that is something that we can report on, But we're having issues with it creating the event on different computers.

I would like help with either creating an email after the .bat file is ran, or a way to generate an event log after it's ran.

Here is the code
@echo off
cd /D C:\users
REM ?-Clean Temp Folder?
for /D %%a in (*.*) do DEL /F /S /Q "%%a\appdata\local\Temp\*.*"
for /D %%a in (*.*) do FOR /D %%b IN ("%%a\appdata\local\Temp\*.*") DO RMDIR /S /Q "%%b"
REM ?-Clean IE Cache?
for /D %%a in (*.*) do DEL /F /S /Q "%%a\appdata\local\microsoft\windows\temporary internet files\*.*"
for /D %%a in (*.*) do FOR /D %%b IN ("%%a\appdata\local\microsoft\windows\temporary internet files\*.*") DO RMDIR /S /Q "%%b"

If you could please edit the code so that it will do one of those two actions
Question by:invisimax
    1 Comment
    LVL 76

    Accepted Solution

    Hi, invisimax.

    Blat is probably the simplest way to accomplish this.  It's a free utility that allows you to send an email from a command line.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
    Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now