Sign in to follow this  
Followers 0
Alux

Im new to Auto it and I have no clue on how to do this.

11 posts in this topic

I want to run a program when I click the autoit script but I also want it to not run if it is already running

Can someone please write me an example script with the program as example.exe and its location is on the desktop.

would be greatly appreciated.

Thx.

~Alux

Share this post


Link to post
Share on other sites



Ok, I would also like to run example2.exe 2 seconds after example.exe.

They are both on the desktop.

They need to launch unless the are already open (using the au3 script)

Once again, I'd appreciate it if someone could write this, Im sure it wouldnt take to long.

Share this post


Link to post
Share on other sites

Check out process exists and run.

Give it a go, and report back here if you run into any issues.

Cheers,

Brett

Dunno what that means lol, as I said I am new and don't know anything about it. (Excpet changing the values on that calculator example script :mellow:)

Share this post


Link to post
Share on other sites

if you have installed autoit and scite and koda, basically the whole package then open scite and press f1 to open the help file, also this is where people say rtfm as you quite clearley havent even tried to look into how to code anything in autoit


Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right.

Share this post


Link to post
Share on other sites

Righto, will try this, thanx

:mellow:

Share this post


Link to post
Share on other sites

You might also look at _Singleton. That function will allow you to run only one instance of a script.

Share this post


Link to post
Share on other sites

You might also look at _Singleton. That function will allow you to run only one instance of a script.

it's for the script exe itself, and it will not work if the script runs another program with same process name.

he can try this

If ProcessExists("Process.exe") Then
    MsgBox(64, "Program Info", "this program is already running.", 10)
Else
    ShellExecute("Program.exe")
EndIf

Enjoy the complexity.Feel the power of simplicity.

Share this post


Link to post
Share on other sites

Are you sure about that?

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=notepad.exe
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include "Misc.au3"
Run (@SystemDir & "\notepad.exe")
Sleep (2000)
if Not _Singleton("notepad_show",1)Then
    Msgbox(0,"Warning","An occurence of test is already running")
    Exit
EndIf
Msgbox(0,"OK","the first occurence of test is running")

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