marshallprank 0 Posted April 14, 2011 Hi, i want to run an exe-file that its name will be changed dynamically. The first Part of the name its XYZ, the second part its V01 (this will be changed dynamically). I want now to write in my code, Run the exe file that begins with XYZ. It is possible? thanks Share this post Link to post Share on other sites
sahsanu 28 Posted April 14, 2011 Just an idea... change it to cover your needs. Note: The search is case insensitive so xyz=XYZ. As soon as there is a match it exits and use that xyz*.exe. #include <file.au3> Global $pathtoexe=@ScriptDir & "\", $exetorun, $findingexe $files=_FileListToArray($pathtoexe,"*.exe") For $i=1 to $files[0] $findingexe=StringRegExp($files[$i],"(?i)^XYZ.*\.exe",1);this regexp is not case sensitive If IsArray($findingexe) Then ;the first match will cause to exitloop $exetorun=$findingexe[0] ExitLoop EndIf Next If $exetorun = "" Then ConsoleWrite("Sorry but I have not found any XYZ*.exe file" & @CRLF) Else ConsoleWrite("The file to be executed is " & $pathtoexe & $exetorun & @CRLF) EndIf Share this post Link to post Share on other sites
marshallprank 0 Posted April 14, 2011 thank you its working Share this post Link to post Share on other sites
JScript 71 Posted April 14, 2011 Hi,i want to run an exe-file that its name will be changed dynamically. The first Part of the name its XYZ, the second part its V01 (this will be changed dynamically). I want now to write in my code, Run the exe file that begins with XYZ. It is possible?thanksHave you ever wanted to use the invisibility cloak of Harry Potter? http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)Somewhere Out ThereJames IngramDownload Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Share this post Link to post Share on other sites