Sign in to follow this  
Followers 0
Zack

Run my program unlimited times if it's name is Example.exe

7 posts in this topic

hello

how do i Run my program unlimited times if it's name is Example.exe?

Share this post


Link to post
Share on other sites



Hi Zack,

Welcome to AutoIt Script Forums.

Here is an example on how to do it.

$name = "Example.exe"
If @ScriptName = $name Then
    While 1
        Some_Function()
        Sleep(100)
    WEnd
EndIf
Func Some_Function()
    ;function code goes here...
EndFunc

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You have to use If Statement to check if the required executable matched with the script name, after that you can use a While loop to run your function inside it.

Check the help file, there is detailed information about everything.

Press F1 in SciTE...

Edited by HavikTech

Share this post


Link to post
Share on other sites

I asked for running another program

Example.exe is some installed software in my laptop

not autoit script itself

Share this post


Link to post
Share on other sites

I asked for running another program

Example.exe is some installed software in my laptop

not autoit script itself

It wasn't exactly very clear in your first post. Anyway, what have you got so far?

Share this post


Link to post
Share on other sites

The script offered only required a small step to fit your needs, not a giant leap...

$name = "C:\Example.exe"
If FileExists($name) Then
    While 1
        RunWait($name)
        Sleep(100)
    WEnd
EndIf
Let's think a little for ourselves

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