Hello all,
I'm trying to put together a script to copy files to a folder based on the date.
The script needs to look at the month and year and based on this information, the folder with the corresponding month is created and files copied to it.
This is what I've come up with so far - see script below
========================Script==============================
'Option Explicit
'On error resume next
Dim FolderPath ' folder to be searched for files
Dim objFSO
Dim objFolder
Dim colFiles
Dim objFile
SearchStrJan = "1"
SearchStrFeb = "2"
SearchStrMar = "3"
SearchStrApr = "4"
SearchStrMay = "5"
SearchStrJun = "6"
SearchStrJul = "7"
SearchStrAug = "8"
SearchStrSep = "9"
SearchStrOct = "10"
SearchStrNov = "11"
SearchStrDec = "12"
FolderPath = "C:\temp"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.Getfolder(FolderPath)
Set colFiles = objFolder.Files
For Each objFile In colFiles
Wscript.Echo objFile.DateCreated
If Instr objFile.DateCreated
Next
'====== Trying to get going with string functions and file properties
Any assistance with this is greatly appreciated
Thanks all
I'm trying to put together a script to copy files to a folder based on the date.
The script needs to look at the month and year and based on this information, the folder with the corresponding month is created and files copied to it.
This is what I've come up with so far - see script below
========================Script==============================
'Option Explicit
'On error resume next
Dim FolderPath ' folder to be searched for files
Dim objFSO
Dim objFolder
Dim colFiles
Dim objFile
SearchStrJan = "1"
SearchStrFeb = "2"
SearchStrMar = "3"
SearchStrApr = "4"
SearchStrMay = "5"
SearchStrJun = "6"
SearchStrJul = "7"
SearchStrAug = "8"
SearchStrSep = "9"
SearchStrOct = "10"
SearchStrNov = "11"
SearchStrDec = "12"
FolderPath = "C:\temp"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.Getfolder(FolderPath)
Set colFiles = objFolder.Files
For Each objFile In colFiles
Wscript.Echo objFile.DateCreated
If Instr objFile.DateCreated
Next
'====== Trying to get going with string functions and file properties
Any assistance with this is greatly appreciated
Thanks all