Maxaki Posted January 21, 2014 Posted January 21, 2014 (edited) Hey. I am using HP Update Assistant to do some driver updates. I cannot interact with it and failed hard to make an ImageSearch. Anyway, between each driver it installs, a certain process launches. This happens about every 3-8minutes. I want it to check every minute for 10 minutes if the process exists. If it hasn't existed in 10 minutes I want it to do next command. Is this possible? With my small knowledge of scripting I think it should be something like: If loop 1 - 10 if not then next... etc /Andreas Edited January 21, 2014 by Maxaki
water Posted January 21, 2014 Posted January 21, 2014 Something like this? For $i = 1 To 10 If ProcessExists("processname or number") Then ExitLoop Sleep(60000) ; Sleep for a minute Next My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Maxaki Posted January 21, 2014 Author Posted January 21, 2014 (edited) Water, Thank you!! Yes. This is what I needed. Awesome Edited January 21, 2014 by Maxaki
water Posted January 21, 2014 Posted January 21, 2014 That was an easy one My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Maxaki Posted January 21, 2014 Author Posted January 21, 2014 (edited) I realised that your script was just checking if the process were there every minute, if it wasn't it exists loop. It helped me make this though. For $i = 1 To 10 For $a = 1 To 9 If ProcessExists("AMPAgent.exe") Then Sleep(60000) Else Sleep(60000) EndIf ;Last try, now it will If ProcessExists("AMPAgent.exe") Then ExitLoop Next It tries 10 times and on the 10th time it will choose either to Exit the loop or to Continue it. The problem here is that I want to make the last If statement know if the other statement was "Then" or "Else" statements because then it can analyze if the program was open or not. This was a little bit more of challenge I guess... Edited January 21, 2014 by Maxaki
michaelslamet Posted January 21, 2014 Posted January 21, 2014 I think you should make it clearer what you want to do
Maxaki Posted January 21, 2014 Author Posted January 21, 2014 (edited) michaelslamet, It's difficult to explain but a friend helped me out, it seems like he solved it. Here is the code For $i = 1 To 60 If ProcessExists("example.exe") Then For $a = 1 to 59 If ProcessExists("example.exe") Then Sleep (10000) Else $i = 1 ExitLoop EndIf Next Else Sleep (10000) EndIf Next Edited January 21, 2014 by Maxaki
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