Solved

Get a list of files from the last modified date

Posted on 2004-04-22
7
215 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
allStar challenge 1 52
Arduino EDI - Programming language 3 80
How can i compile this github project?? 2 76
"Black Box" Testing of Control System Software 2 26
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

861 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

24 Experts available now in Live!

Get 1:1 Help Now