@echo off
REM Define log file and directory to check
set olddir=C:\scripts\olddir.txt
set nowdir=c:\scripts\nowdir.txt
set check=c:\my_folder
REM Create directory for scripts if doesn't exist
mkdir c:\scripts 2>NUL
REM Rename previous run log file
if exist "%oldir%" del "%olddir%"
if exist "%nowdir%" (
rename "%nowdir%" "%olddir%"
dir "%check%" > "%nowdir%"
fc "%nowdir%" "%olddir%
if "%errorlevel%"==0 call :email
) ELSE echo This is the first run so no comparison done
exit /b
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.
TRUSTED BY
http://scripts.dragon-it.co.uk/links/email-from-batch