Alux Posted November 1, 2008 Share Posted November 1, 2008 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 More sharing options...
Alux Posted November 1, 2008 Author Share Posted November 1, 2008 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 More sharing options...
BrettF Posted November 1, 2008 Share Posted November 1, 2008 Check out process exists and run. Give it a go, and report back here if you run into any issues. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Alux Posted November 1, 2008 Author Share Posted November 1, 2008 Check out process exists and run.Give it a go, and report back here if you run into any issues.Cheers,BrettDunno 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 ) Link to comment Share on other sites More sharing options...
BrettF Posted November 1, 2008 Share Posted November 1, 2008 Have you found the helpfile yet? If not have a look for it. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
FaT3oYCG Posted November 1, 2008 Share Posted November 1, 2008 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 More sharing options...
Alux Posted November 1, 2008 Author Share Posted November 1, 2008 Righto, will try this, thanx Link to comment Share on other sites More sharing options...
Reaper HGN Posted November 1, 2008 Share Posted November 1, 2008 You might also look at _Singleton. That function will allow you to run only one instance of a script. Link to comment Share on other sites More sharing options...
Cw2K1 Posted November 1, 2008 Share Posted November 1, 2008 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 More sharing options...
BrettF Posted November 1, 2008 Share Posted November 1, 2008 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") Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Bert Posted November 2, 2008 Share Posted November 2, 2008 Welcome to the forum. You can take AutoIt 1-2-3 to get up to speed on how to use AutoIt. http://www.autoitscript.com/forum/index.php?showtopic=21048 The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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