marshallprank Posted April 14, 2011 Share 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 Link to comment Share on other sites More sharing options...
sahsanu Posted April 14, 2011 Share 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 Link to comment Share on other sites More sharing options...
marshallprank Posted April 14, 2011 Author Share Posted April 14, 2011 thank you its working Link to comment Share on other sites More sharing options...
JScript Posted April 14, 2011 Share 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 Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! 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