'assumes c:\in exists and has all the files and recursive folders you want to copy
'assumes c:\out exists
sourceDir = "c:\in"
destinationDir = "c:\out"
const OverwriteExisting = True
' I used the replace function to change the date format from 8/22/2008 to 8_22_2008
' because the / is not allowed in a file or folder name
strDirectory = destinationDir & "\" & replace(date,"/","_")
Set fso = CreateObject("Scripting.FileSystemObject")
' The script will error out if it tries to create a directory that already exist
' so it is better to check for it first and only attempt to create it if it does
' not exist.
if not fso.FolderExists(strDirectory) then
' If it gets here then the folder for the current date does not yet exist and
' therefore is created.
Set objFolder = fso.CreateFolder(strDirectory)
end if
' This copies the folder and overwrites them if they exist.
fso.CopyFolder sourceDir , strDirectory & "\", OverwriteExisting
' If you entend to automate this script you should remove or rem out this next line.
wscript.echo "Done"