I want to make a software
which can find the oldest folder(create time)
and delete it
can u give me some hints?
Printable View
I want to make a software
which can find the oldest folder(create time)
and delete it
can u give me some hints?
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.
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)