I wrote a tiny batch file a while ago that creates a folder string with the date and time then makes a folder with that string and copies files daily to an external drive for backup purposes. Its grown into a windows event creator and a text file creation with the date and time of start and finish. I thought I would paste them here for anyone to use.
Start of batch file (comment lines are REMmed out to help with creation:
REM ****** Run VBS File to create Event log for start of file copy in Information Log ******
REM ****** Set FOlder String to current date and time ******
REM ****** Make Directory on resource calling folder string ******
REM ****** Create text file in folder string stating copy start ******
echo Start date and time: %date% - %time% >> e:\hddaily\%folder%\cpresult.txt
REM ****** Copy files to resource ******
xcopy \\SERVER LOCATION\*.* e:\HDDaily\%folder% /c /h /e /v /y
REM ****** Append end time and date to text file created in folder string ******
echo End date and time: %date% - %time% >> e:\hddaily\%folder%\cpresult.txt
REM ****** Run VBS file to create event log for end of file copy in Information log ******
Start of VBS FILE (file that creates the event log):
' Constants for type of event log entry
const EVENTLOG_SUCCESS = 0
const EVENTLOG_ERROR = 1
const EVENTLOG_WARNING = 2
const EVENTLOG_INFORMATION = 4
const EVENTLOG_AUDIT_SUCCESS = 8
const EVENTLOG_AUDIT_FAILURE = 16
strMessage = "HomeDirs Batch FIle Copy Started"
set objShell = CreateObject("WScript.Shell")
objShell.LogEvent EVENTLOG_INFORMATION, strMessage
Just change the strMessage to whatever you want and then copy the file to make another one that "ends" the event. Thanks to Pat for the "double greater thans" that append text to a file and to Jake for the sexy VB script.