Solved

Get a list of files from the last modified date

Posted on 2004-04-22
7
203 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
  • 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A short article about a problem I had getting the GPS LocationListener working.
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now