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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Script to count files from a folder and email them

Status
Not open for further replies.

TechAbhiVaray

Technical User
May 13, 2010
8
US
Hello All,

This is what i have so far:

im oFS, oFolder
set oFS = WScript.CreateObject("Scripting.FileSystemObject")
set oFolder = oFS.GetFolder("C:\inetpub\ftproot\photos\")

ShowFolderDetails oFolder

sub ShowFolderDetails(oF)
dim F

wscript.echo oF.Name & ":#Files=" & oF.Files.Count


for each F in oF.Subfolders
ShowFolderDetails(F)
next
end sub

****************************************
This gives me a count of the number of files in the folder. I want the count from yesterday, so whenever i run the vbs it will give me the number of files added in the folder in the last 24 hours. I am going to use task scheduler to run it once everyday, so it tells me the number of files added in the last 24 hrs.
How do i get to make this file email myself??? Any help will be appreciated!
 
added in the last 24 hours? thats nothing to do with the datelastmodified? or datecreated? or perhaps it is? which property of your file do you think would serve your purpose?
if there is none then perhaps you will need to keep an audit yourself? of what was the state of the folder v. what is the current state
 
I agree with mrmovie. There isn't a file property (that I know of) capable of telling you when it was "added" to a folder. Although, you may be able to use .DateLastAccessed to compile this list. However, there are several factors that could give you a false positive. It may be easier to code a daily audit.

-Geates
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top