dim filesys set filesys=CreateObject("Scripting.FileSystemObject") If filesys.FileExists("c:\sourcefolder\anyfile.html") Then filesys.MoveFile "c:\sourcefolder\anyfile.html", "c:\destfolder\" End If
Get the last modified date and time of a file
Private Function FileDateTime(byVal pathname) Dim objFSO, objFile On Error Resume Next Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.GetFile(pathname) If Err Then FileDateTime = Null Else FileDateTime = CDate( objFile.DateLastModified ) End If Set objFile = Nothing Set objFSO = Nothing On Error GoTo 0 End Function or 'http://www.devguru.com/technologies/vbscript/quickref/file.html Dim filesys, fileinfo, createdate Set filesys = CreateObject("Scripting.FileSystemObject") Set fileinfo = filesys.GetFile(filename) createdate = fileinfo.DateCreated