CD5 Posted May 11, 2019 Share Posted May 11, 2019 hello , please excuse my lack of proper terms or any ignorance to fundemental things as i have just started using autoit and have no idea what im doing i am trying to check for a prosses "msiafterburner.exe" and if its not there run it "Run(@ProgramFilesDir & "c:\program files (x86)\msi afterburner\msiafterburner.exe", "", @SW_MINIMIZE)" and i am trying to keep it in a loop so it checks every 5 seconds and makes sure msi afterburner is on. apon running the file attached i get "C:\Users\admin\Desktop\test1.au3" (7) : ==> "Wend" statement with no matching "While" statement.: Im not sure what exactly is wrong here so perhaps someone would be willing to explane to me what im doing wrong so i can learn how to do it right, Thanks. test1.au3 Link to comment Share on other sites More sharing options...
Earthshine Posted May 11, 2019 Share Posted May 11, 2019 (edited) Your path is WRONG. you use ProgramDir and then concatenate a hardcoded path as well post your whole script Edited May 11, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
CD5 Posted May 11, 2019 Author Share Posted May 11, 2019 thanks for the quick reply , the test1.au3 that should be attached is the whole script that i have got , as i said im just starting to get into scripts and coding in general. about the path , what exactly is wrong ? would Run("c:\program files (x86)\msi afterburner\msiafterburner.exe", "", @SW_MINIMIZE) function correctly (as in removing the @ProgramFilesDir &)? Link to comment Share on other sites More sharing options...
supraaxdd Posted May 11, 2019 Share Posted May 11, 2019 (edited) From what I am seeing in the thread you wrote you want it to check for the MSIAfterBurner every 5 seconds. The Sleep Command pauses the loop and that will be the five seconds I'd imagine. If there is a more experienced member that can correct me if I'm wrong, be my guest I tested it out and it will make a MsgBox appear every 5 seconds so I think I've done it Below find what I think might be the solution to your question. Try it out and come back to me if I was right or wrong. While 1 If ProcessExists("C:Program Files (x86)\msi afterburner\msiafterburner.exe") Then MsgBox(0, "", "This program is already running.") Sleep(5000) Else Run("C:\Program Files (x86)\msi afterburner\msiafterburner.exe") MsgBox(0, "", "This program wasn't running, we are starting it up right now.") Sleep(5000) EndIf WEnd Regards, Supra EDIT: I forgot to minimize it, you have to add the @SW_MINIMIZE yourself as I forgot. Also, I'm not sure what the directory was, so you might have to change that aswell... Edited May 11, 2019 by supraaxdd Link to comment Share on other sites More sharing options...
Developers Jos Posted May 11, 2019 Developers Share Posted May 11, 2019 11 minutes ago, supraaxdd said: ProcessExists("C:Program Files (x86)\msi afterburner\msiafterburner.exe") Are you sure? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
supraaxdd Posted May 11, 2019 Share Posted May 11, 2019 (edited) 1 minute ago, Jos said: Are you sure? Jos He did ask for the loop to check if the Process Exists, hence this line. Would I be wrong here? If yes, why? I'm trying to help in the best way I can. Please excuse my errors... Regards, Supra Edited May 11, 2019 by supraaxdd Link to comment Share on other sites More sharing options...
Developers Jos Posted May 11, 2019 Developers Share Posted May 11, 2019 Does a processname contain the fully qualified path? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
supraaxdd Posted May 11, 2019 Share Posted May 11, 2019 (edited) 2 minutes ago, Jos said: Does a processname contain the fully qualified path? That is the path he stated, hence my edit to change it if I'm wrong EDIT: Nevermind, I found out why I'm wrong... It's only the PID or Process name WITHOUT the directory. My bad Edited May 11, 2019 by supraaxdd Link to comment Share on other sites More sharing options...
Developers Jos Posted May 11, 2019 Developers Share Posted May 11, 2019 Try to reread my question, think, search , test and then reply again. supraaxdd 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
supraaxdd Posted May 11, 2019 Share Posted May 11, 2019 Just now, Jos said: Try to reread my question, think, search , test and then reply again. Just did, Help Files all the way Regards, Supra Link to comment Share on other sites More sharing options...
Developers Jos Posted May 11, 2019 Developers Share Posted May 11, 2019 So what is the correct answer? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
supraaxdd Posted May 11, 2019 Share Posted May 11, 2019 (edited) While 1 If ProcessExists("msiafterburner.exe") Then MsgBox(0, "", "This program is already running.") Sleep(5000) Else Run("msiafterburner.exe") MsgBox(0, "", "This program wasn't running, we are starting it up right now.") Sleep(5000) EndIf WEnd Pretty sure it is Edited May 11, 2019 by supraaxdd Link to comment Share on other sites More sharing options...
Developers Jos Posted May 11, 2019 Developers Share Posted May 11, 2019 (edited) Close but probably still wrong. The test for the process will be correct now, but doubt the Run() will work unless that directory is specified in the "PATH". Jos Edited May 11, 2019 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
CD5 Posted May 11, 2019 Author Share Posted May 11, 2019 the above is working just like i wanted it to however after closeing msi afterburner the "This program wasn't running, we are starting it up right now." message apears but does not start the program , any suggestions? Link to comment Share on other sites More sharing options...
supraaxdd Posted May 11, 2019 Share Posted May 11, 2019 Just now, Jos said: Close but probably still wrong. The test for the process will be correct now, but doubt the Run() will work unless that directory in is the "PATH". Jos I'm starting to have that feeling that I have a long way to go Here's the correct answer: While 1 If ProcessExists("msiafterburner.exe") Then MsgBox(0, "", "This program is already running.") Sleep(5000) Else Run("C:\Program Files (x86)\msi afterburner\msiafterburner.exe") MsgBox(0, "", "This program wasn't running, we are starting it up right now.") Sleep(5000) EndIf WEnd Sorry for my stupidity Regards, Supra Link to comment Share on other sites More sharing options...
Developers Jos Posted May 11, 2019 Developers Share Posted May 11, 2019 1 minute ago, supraaxdd said: Sorry for my stupidity It is not about stupidity, merely taking the time to think it through...understand... and moreover TEST... which is called in general "learning". Jos supraaxdd 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
supraaxdd Posted May 11, 2019 Share Posted May 11, 2019 Just now, Jos said: It is not about stupidity, merely taking the time to think it through...understand... and moreover TEST... which is called in general "learning". Jos Thanks for pointing out my mistakes Regards, Supra Link to comment Share on other sites More sharing options...
CD5 Posted May 11, 2019 Author Share Posted May 11, 2019 thanks for the correction , the path is correct and everything looks good however the program is still not starting , i will check the program and perhaps test the same script but on a diffrent program to make sure msi afterburner is not at fault for it not starting up. thanks a bunch for all your support guys il post if i find anything new but scrip looks good supraaxdd 1 Link to comment Share on other sites More sharing options...
supraaxdd Posted May 11, 2019 Share Posted May 11, 2019 6 minutes ago, CD5 said: the above is working just like i wanted it to however after closeing msi afterburner the "This program wasn't running, we are starting it up right now." message apears but does not start the program , any suggestions? After some further testing, I tried to do it with Steam. It works fine. Check if the MSIAfterBurner is running in the backround. Regards, Supra Link to comment Share on other sites More sharing options...
supraaxdd Posted May 11, 2019 Share Posted May 11, 2019 1 minute ago, CD5 said: thanks for the correction , the path is correct and everything looks good however the program is still not starting , i will check the program and perhaps test the same script but on a diffrent program to make sure msi afterburner is not at fault for it not starting up. thanks a bunch for all your support guys il post if i find anything new but scrip looks good Did you see the afterburner in the Task Manager as a background task? Also, there could be other programs interfering with it. here is what I mean: All of these are Steam processes. Once I closed off the Bootstrapper, All the below programs were closed off a few seconds later BUT when the others were closing, the loop recognised the Webhelpers as STEAM and sent the message that the program was still running. Check the task manager for any programs related to the afterburner and check in the background tasks if it is running and come back to me. Regards, Supra 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