?
Solved

Get a list of files from the last modified date

Posted on 2004-04-22
7
Medium Priority
?
251 Views
Last Modified: 2010-04-17
I have a folder on a drive called "global",
I want a listing of all files from dir & sub dir
by last mod date .
0
Comment
Question by:CMILLER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 4

Expert Comment

by:JpmSoft
ID: 10894670
This seems to be very simple... Try this:

Use FileSystemObject to get Files and Folder information...
(Add a reference to Microsoft Scripting runtime an declare it as follows:
Dim FSO As New FileSystemObject)

Then build an array and sort it using a generic array sort routine like this...

Public Sub BubbleSort(ByRef lngArray() As Long)
    Dim iOuter As Long
    Dim iInner As Long
    Dim iLBound As Long
    Dim iUBound As Long
    Dim iTemp As Long
   
    iLBound = LBound(lngArray)
    iUBound = UBound(lngArray)
   
    'Which bubbling pass
    For iOuter = iLBound To iUBound - 1
        'Which comparison
        For iInner = iLBound To iUBound - iOuter - 1
       
            'Compare this item to the next item
            If lngArray(iInner) > lngArray(iInner + 1) Then
                'Swap
                iTemp = lngArray(iInner)
                lngArray(iInner) = lngArray(iInner + 1)
                lngArray(iInner + 1) = iTemp
            End If
           
        Next iInner
    Next iOuter
End Sub

This could help!
0
 
LVL 8

Accepted Solution

by:
harris_c earned 1200 total points
ID: 10896654
0
 

Author Comment

by:CMILLER
ID: 10902836
How do I get either to run, need more guidance
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:CMILLER
ID: 10902980
I copied the text from http://www.annoyances.org/exec/forum/win2000/t1062537093
and created a getfolders.vbs, it worked but here is what I get

Folder 'software' was last modified on Friday, April 16, 2004 at 1:23:25 PM

I need the files also

this global dir has
 
2644 folders
39224 files

so I cant make a text file with all this info, I need a script that will
go through the dir global and output this info

d:\global\dirx\ ( list all files with the date and time last accessed )
d:\global\dirx\

0
 

Author Comment

by:CMILLER
ID: 10953811
jpmsoft,

how do I get this to run?
0
 
LVL 4

Assisted Solution

by:JpmSoft
JpmSoft earned 800 total points
ID: 10953873

Here is an example of how to do this.

http://www.roubaixinteractive.com/PlayGround/FSO/Sort_Folder_Contents.asp?orderBy=DESC&sortBy=Size

in this case, the programmer uses a ADO Recordset object for sorting (wich is not a bad idea) but if you don't want to use ADO, you may use this bubblesort function as I told you before.

Good Luck!
0
 

Author Comment

by:CMILLER
ID: 11000020
Still no luck in creating this script
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Progress
Introduction to Processes

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question