File creation date. No change?




I have a vbscript script that archives a file by moving it to an archive
folder, before ftp downloading another version of the file. When the file is
archived, its moved from the download folder to the archive folder and
renamed to a different filename. The file name of the downloaded file is
always the same.

The problem-
The first thing the script does is archive the file. So the file is moved
from the download folder to the archive folder and renamed. What I expect is
that when a new file is ftp downloaded, it would have a newer creation date
than the archived file, since there is no existing file in the download
folder. But what I'm finding is that the new file has a newer modified date
and the same creation date!

What am I missing?

Script below:

'Archive the previously downloaded file.
If (objFSO.FileExists(strDataFolder & "\" & strDataFile)) Then
strTmpFA = GetFileAttribs(strDataFolder, strDataFile)
strFileAttribs = split (strTmpFA,",")
strFileCDate = Mid(strFileAttribs(3),1,8)
intN = 0
strTmpFCD = strFileCDate
' Loop till we get a unique filename
Do while objFSO.FileExists (strArcFolder & "\" & strDataFile & "-" &
strTmpFCD)
intN = intN + 1
strTmpFCD = strFileCDate & "-" & intN
Loop
strFileCDate = strTmpFCD
' Move the file using new filename
objFSO.MoveFile strDataFolder & "\" & strDataFile, strArcFolder & "\" &
strDataFile & "-" & strFileCDate
End if

' FTP the next file
objShell.Run "%comspec% /C ftp -s:" & strFTPCmdFile & " >" & strTmp, 0, True

' Get and return file attributes
Function GetFileAttribs(strFPath, strTargetFile)
Dim strNewDstPath, arrFileAttrib(4)
Dim objWMIService, objFile, colFiles

strNewDstPath = strFPath & "\" & strTargetFile
'filepath must use \\ instead of \
strNewDstPath = Replace(strNewDstPath,"\","\\")

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & "." & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_Datafile Where name = '" & strNewDstPath & "'")
for each objFile in colFiles
arrFileAttrib(0) = objFile.FileName & "." & objFile.Extension
arrFileAttrib(1) = objFile.Drive & objFile.Path
arrFileAttrib(2) = objFile.FileSize
arrFileAttrib(3) = objFile.CreationDate
next
GetFileAttribs = join (arrFileAttrib,",")
End Function
.



Relevant Pages

  • Re: File creation date. No change?
    ... confusing if a file creation date changes when I copy the file. ... I have a vbscript script that archives a file by moving it to an archive ... folder, before ftp downloading another version of the file. ... from the download folder to the archive folder and renamed. ...
    (microsoft.public.windows.server.scripting)
  • [SLE] Mystery .link hidden subdir under KDE Base update
    ... This folder contains links to all the rpm files placed at ... When I was downloading the KDE 3.43 ... I noticed that my download was of more than the 17 files and 44.3 MB ... Also check the archives at http://lists.suse.com ...
    (SuSE)
  • Re: IE6 overwrites anything I try to type in to the address bar
    ... install of WinXP with all of the updates/hot fixes installed before anything ... download a copy of LSPFIX from any of the following sites: ... > enable you to regain your connection. ... > folder after appropriate unzipping, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: IE6 and "TV Media"
    ... TV Media is still somewhere on your system, and may not be detected by ... Download, install, immediately update the definitions, and then run AdAware ... get a copy of WinsockFix Utility ... and download HiJackThis to the new folder. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Paradox Community String Library : Readme.txt
    ... There is a decent main form in the download to showcase what is included. ... Robert Wiltshire ... I would copy the entire download into its own folder. ... This is a developers tool that I created for people who write code. ...
    (comp.databases.paradox)