Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
prog = WshShell.ExpandEnvironmentStrings("%ProgramFiles%")
objStartFolder = prog & "\uptime4\GUI\published\" & Year(Date) & "\" & (MonthName((Month(Date))))
Set objFolder = objFSO.GetFolder(objStartFolder)
Set colFiles = objFolder.Files
For Each objFile in colFiles
Fildato = (Left(objFile.datelastmodified, 10))
If Fildato = Date Then
pos=InStr(objFile.Name,"_")
Filnavn = (Left(objFile.Name,pos-1)) & "_current.html"
objFSO.CopyFile objStartFolder & "\" & objFile.Name , objStartFolder & "\" & Filnavn , OverwriteExisting
End If
Next
|