Results 1 to 3 of 3

Thread: [2005] oldest folder

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    96

    [2005] oldest folder

    I want to make a software
    which can find the oldest folder(create time)
    and delete it

    can u give me some hints?

  2. #2
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: [2005] oldest folder

    yes but keep in mind the oldest create time might have a brand new file inside it.

    I am new to vb.net but you can read the file (or directory) creation time with system.io.directoryinfo

    you should be able to use the DIR command to enumerate all the directories.

    once you figure out these three things it should be easy to check the filetimes in a loop, mark the oldest, and delete it.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  3. #3
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: [2005] oldest folder

    ok here's another hint. I used this code snippet to return the folder creation time of c:\windows
    Code:
            Dim fileData As FileInfo = My.Computer.FileSystem.GetFileInfo("C:\windows")
            MsgBox(fileData.CreationTime)
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width