Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help to Count Files

Status
Not open for further replies.

Ehvbs

Programmer
Mar 13, 2009
2
US
Hey Guru's,

Please some one lead me,how to count files in two folder using time frame.

I know count files in the folder is simple,i trying to count files like

1st run from 9Am to 12 PM
2nd run from 12Pm to 3 PM.

Like this.

***********************************************************
Dim oFS, SourceFolder,DestFolder,Source,Dest,demofolder,foldername
set oFS =CreateObject("Scripting.FileSystemObject")
set SourceFolder = oFS.GetFolder("c:\sourcefolder")
Set DestFolder=oFS.GetFolder("c:\destfolder")
'Set demofolder=oFS.GetFolder("c:\destfolder")
Set demofolder=oFS.GetFile("c:\destfolder\")

foldername=demofolder.Name

WScript.Echo foldername

Source= SourceFolder.Files.Count
Dest= DestFolder.Files.Count
ShowsourceFolderDetails SourceFolder
ShowdestFolderDetails DestFolder

If Source=Dest Then
WScript.Echo "SYNC"
Else
WScript.Echo "NON SYNC"
End if

sub ShowsourceFolderDetails(SourceFolder)
dim F
wscript.echo SourceFolder.Name & ":Size=" & SourceFolder.Size
wscript.echo SourceFolder.Name & ":#Files=" & SourceFolder.Files.Count
wscript.echo SourceFolder.Name & ":#Folders=" & SourceFolder.Subfolders.count
wscript.echo SourceFolder.Name & ":Size=" & SourceFolder.Size
F=SourceFolder.Files.Count
'for each F in SourceFolder.Subfolders
' ShowsourceFolderDetails(F)
'next

end Sub

Sub ShowdestFolderDetails(DestFolder)
Dim D
WScript.Echo "DEST COUNT" & DestFolder.Files.Count
D=DestFolder.Files.Count
End sub


********************************************************

Pleas help me to add a time frame in this logic.

Thanks in Advance
EHVBS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top