Sign in to follow this  
Followers 0
masvil

Sort files

3 posts in this topic

#1 ·  Posted (edited)

I have a script like this:

$search = FileFindFirstFile("*.txt")
If $search <> - 1 Then
   While
      $file = FileFindNextFile($search)
      If @error Then ExitLoop
      RunWait(@ComSpec & " /c start " & $file, @ScriptDir, @SW_HIDE)
   Wend
EndIf
FileClose($search)

... how can I sort by date files opening?

Edited by masvil

Share this post


Link to post
Share on other sites



You can use FileGetTime and a quicksort or bubble sort algorithm (look for quicksort or bubble sort on the forum) or you can use comspec and use dir with the right options to sort them.


Who else would I be?

Share this post


Link to post
Share on other sites

[..]or you can use comspec and use dir with the right options to sort them.

... like this (use the /OD parameter)

:idiot:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0