Solved

Get a list of files from the last modified date

Posted on 2004-04-22
7
244 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 300 total points
ID: 10896654
0
 

Author Comment

by:CMILLER
ID: 10902836
How do I get either to run, need more guidance
0
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 

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 200 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Simple Linear Regression
Introduction to Processes

726 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