Jump to content

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


Alux
 Share

Recommended Posts

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

Link to comment
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.

Link to comment
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:)

Link to comment
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.

Link to comment
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.
Link to comment
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")
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...