Computing.Net > Forums > Programming > How do I send email with batch file

How do I send email with batch file

Reply to Message Icon

Original Message
Name: Rashar
Date: April 3, 2008 at 08:03:57 Pacific
Subject: How do I send email with batch file
OS: Vista
CPU/Ram: 1.67, 2 gig
Comment:

Hello,

Consider the following batch script that takes a file, and stores it on the desktop of each user:

@echo off
copy "C:\Folder1\doc1.doc" "C:\Documents and Settings\All Users\Desktop\Folder2"
pause

Right after the file is copied to Folder2, how can I have that script automatically send an email to me for confirmation that the script was run?

Or if I could have something that would automatically create a text file that says something like, "Script Run at 12pm"

Thanks in advance

Hello,

I've been seeing alot of info on how to run vista as an Administrator. Using Command prompts to enable the account, or right clicking on an application and choosing Run as Administrator.

Du


Report Offensive Message For Removal


Response Number 1
Name: Mechanix2Go
Date: April 4, 2008 at 03:56:59 Pacific
Subject: How do I send email with batch file
Reply: (edit)

After the COPY:

if errorlevel ( set result=FAILED
) else (
set result=OK
)
echo run at %date% %time% %result% >> log


=====================================
If at first you don't succeed, you're about average.

M2


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: How do I send email with batch file

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge