neo van matix Posted May 30, 2006 Share Posted May 30, 2006 Hello, i'd like to write a little Script, which updates my Virus-Definitions. On a local Server a Program is running, which writes every day an definition-exe. The problem is, that the version of the definition-exe is namend in the filename, like def24444.exe. On every update, the filename varied. I need the filename to run the program, i tested "run("def*.exe")", dont work. So i tried to get the name via FileFindFirstFile(), but that returns 0 and no name :/ Some ideas? Attention! English noob ^^ Link to comment Share on other sites More sharing options...
Nomad Posted May 30, 2006 Share Posted May 30, 2006 This was taken directly from the help menu, and it worked fine for me. FileChangeDir("set_the_directory_you_need_here") ; Shows the filenames of all files in the current directory, note that "." and ".." are returned. $search = FileFindFirstFile("def*.exe") ; 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) WEnd ; Close the search handle FileClose($search) You just need to select the directory it will be stored at, then it will display every file that matches the description. You will need to fine tune it to find the specific file you want though. Nomad Link to comment Share on other sites More sharing options...
neo van matix Posted May 30, 2006 Author Share Posted May 30, 2006 Works, and i dont know why... Maybe, because i didnt change the File Dir :/ thanks Attention! English noob ^^ Link to comment Share on other sites More sharing options...
Nomad Posted May 30, 2006 Share Posted May 30, 2006 anytime. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now