| 1. |
Solve : Listing Original File Creation Dates? |
|
Answer» Would anyone being willing to help a DOS novice with a problem. I am trying to produce a list of all files on an EXTERNAL storage device based upon the file creation date prior to being copied to the drive. The creation date for most if not all files on the drive is the date that the files were copied to the drive. Is there a field that can be VIEWED, which shows the original creation date for a given file? Additionally, is there a method to using the DIR command to list all files created after or before a given date, that happen to be archived in multiple subdirectories on the drive? Any assistance would be greatly appreciated. Would anyone being willing to help a DOS novice with a problem. I am trying to produce a list of all files on an external storage device based upon the file creation date prior to being copied to the drive. The creation date for most if not all files on the drive is the date that the files were copied to the drive. Is there a field that can be viewed, which shows the original creation date for a given file? Additionally, is there a method to using the DIR command to list all files created after or before a given date, that happen to be archived in multiple subdirectories on the drive? Any assistance would be greatly appreciated.problem with DIR is that its not able to show you the date creation till the seconds LEVEL...i have seen how it can be done in pure batch, but its tedious. if you don't mind vbscript...here's one Code: [Select]On Error Resume Next Set objFSO = CreateObject("Scripting.FileSystemObject") strFolder="c:\temp" 'you can pass in as script argument too... Set wshArgs = WScript.Arguments If wshArgs(0) = "" Or wshArgs(1) = " " Then WScript.Echo "Usage: cscript /nologo " & Wscript.ScriptName & " "& """MM-DD-YYYY HH-MM-SS""" & " -b(efore)|-a(fter)" WScript.Quit(1) End If dateToCheck = wshArgs(0) WScript.Echo dateToCheck b4after = wshArgs(1) Sub DoWalk(sDir) Set objFolder = objFSO.GetFolder(sDir) For Each Files In objFolder.Files numDays = DateDiff("d", Files.DateCreated , dateToCheck) If Right(b4after,1) = "a" And numDays < 0 then WScript.Echo Files, Files.DateCreated ElseIf Right(b4after,1) = "b" And numDays > 0 Then WScript.Echo Files, Files.DateCreated End If Next For Each oDir in objFolder.SubFolders DoWalk oDir.Path Next End Sub DoWalk strFolder usage: save as myscript.vbs, and on command line, TYPE cscript /nologo myscript.vbs. |
|