Clay Posted April 25, 2008 Share Posted April 25, 2008 Hey guys, I have a small issue that is a little troublesome to me and I am hoping that someone who is a little more familiar with Autoit would be able to point me in the right direction. I have a script that I would like to detect if there is an .exe file (ANY) in its directory and if so run it. The problem is I have other files in the directory which are NOT .exe files... and the . exe file name is unpredictable. For instance the file could be A.exe or B.exe ..and so on. I am trying to use _PathSplit() in order to get the extension of the file.... but in order to me to get the extension I have to have previously known the file name. Is there a more clever way or other way of doing this? Can someone point me in the right direction....Please NOTE: I did not include any code because my code obviously does not work Link to comment Share on other sites More sharing options...
ProgAndy Posted April 25, 2008 Share Posted April 25, 2008 Use FileFind... Functions: $search = FileFindFirstFile(FileGetShortName(@ScriptDir)&"\*.exe") $FirstExe = FileFindNextFile($search) FileClose($search) MsgBox(0, '', $FirstExe) *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Clay Posted April 25, 2008 Author Share Posted April 25, 2008 That seems to do it. Thanks Prog. 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