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

Report Assistance

Status
Not open for further replies.

Jimmy2128

Programmer
Feb 6, 2003
58
0
0
US
I have a f drive shared folder which contain about 150 subfolder for different department. I need to be able to create a report of which files are older than December 2004 and identify the exact location. What would be the best way to execute this task? Thanks for any assistance.

Regards,
 
This code is not perfect, but hopefully it will steer you in the right direction.

Dim strFileList
Dim strExportPath
Dim nSentCnt As Integer
strExportPath = "C:"

strFileList = Dir(strExportPath & "\*")
If strFileList <> "" Then
nSentCnt = 0
Do Until strFileList = ""

nSentCnt += 1

MsgBox((strFileList))
' Get File Name
strFileList = Dir()
MsgBox(File.GetCreationTime(strExportPath & "\" & strFileList))
NextFile:
Loop
End If

I hope this helps.

Ron

Ron Repp
 
This code shows all the names within a top-level directory. This is not my code, and I'd give credit to whomever wrote it, but I haven't the foggiest.

Dim MyPath As String
Dim MyName As String

MyPath = "c:\" ' Set the path.
MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry.
Do While MyName <> "" ' Start the loop.
' Ignore the current directory and the encompassing directory.
If MyName <> "." And MyName <> ".." Then
' Use bitwise comparison to make sure MyName is a directory.
If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
Console.WriteLine(MyName) ' Display entry only if it
End If ' it represents a directory.
End If
MsgBox(MyName)
MyName = Dir() ' Get next entry.
Loop

I hope this helps.

Ron



Ron Repp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top