Sign in to follow this  
Followers 0
marshallprank

run exe that name changes dynamically

4 posts in this topic

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



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

thank you its working :unsure:

Share this post


Link to post
Share on other sites

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

Have you ever wanted to use the invisibility cloak of Harry Potter? :unsure:

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Share this post


Link to post
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
Sign in to follow this  
Followers 0