Jump to content

Script to select and run files?


Recommended Posts

Folks,

I'm looking for a script that allows me to select files from a directory and generate such a list that I can then submit to a batch running process (which is to say that after someone selects a handful of files each one, one at a time, will be sent to another program for processing).

I have to believe this is the sort of thing folks have done before and rather than reinvent the wheel I'm just looking for a sample I can modify for my own purposes. Can anyone point me to something similar?

Link to comment
Share on other sites

; Shows the filenames of all files in the current directory
$search = FileFindFirstFile("c:\temp\*.*")  

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    
    MsgBox(4096, "File:", $file)
    
;; run your command here
    
WEnd

; Close the search handle
FileClose($search)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...