Jump to content

AutoItX slow working after Windows 10 upgrade


Recommended Posts

Hello everyone.
I always try to work with old Windows 10 versions as much as possible because I know mane compatibility issues with Windows 10 upgrading. 
But I couldn't do anything else (I got drivers problem), and nothing couldn't help me besides upgrading, so I upgraded from 1807 to 1903.
And...get another problem ūüėÉ
I use AutoitX library in external project like this.

ObjectAutoIt=New COMObject("AutoItX3.Control");
ObjectAutoIt.AutoItSetOption("WinTextMatchMode",2);
        While ObjectAutoit.WinExists("",WindowHeader) Cycle 
            ObjectAutoIt.WinClose("",WindowHeader);
        EndCycle;
After upgrade I get that this line code 

While ObjectAutoit.WinExists("",WindowHeader)

become extremely low - ~ 20 seconds even if 10 windows open. But before upgrade it takes 0.5 s for a max.

And every time that this code line passes through  - it takes ~20s, (20.115, for example), not less, not more. Something pauses it to work.
How can I diagnose, what is that?
I tried reinstall whole AutoIt, but no results.
Thanks to all.

Edited by poddex
Link to post
Share on other sites

I'm not sure this is true for AutoItX as well but IIRC there was a thread regarding slow performance with Windows 10.
Please search the forum an you will find something like this:

I think this problem is solved with the latest beta:

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-11-10 - Version 1.6.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 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 (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites

The code from 1st post:

ObjectAutoIt=New COMObject("AutoItX3.Control");
ObjectAutoIt.AutoItSetOption("WinTextMatchMode",2);
        While ObjectAutoit.WinExists("",WindowHeader) Cycle 
            ObjectAutoIt.WinClose("",WindowHeader);
        EndCycle;

does this: when Project Windows closed, it finds all related folder-windows and closes them. Only folders are affected.

By testing slow-error, I found, that first iterations passes quickly, folders closes by it. But after closing last folder WinExists loop got a huge delay (~20 s) - on a line "While ObjectAutoit.WinExists("",WindowHeader) Cycle". So, delay appears at last of loop execution, only AFTER all windows matched for a condition (""",WindowHeader" ) close.
Need help with further diagnostic

Link to post
Share on other sites

Ok, I made some diag for this. And found, that I can't even sort opened windows by it's PIDs. I can't select only explorer-related folders for WinExists-condition and WinExists checked title-condition for ALL windows (by logic, yes, but I prove this one more time for me). Some of them caused WinExists function for huge delay described above. imho, it's not effective to see ALL windows, when I want to look for windows of a specific process. But I can't select it. I can get WinList habdles massive, I can get WinGetProcess PID (only one), but I can't point WinExists to look only for Windows caused by specific PID. And I can't to check which handle from WinList is for which PID to close them.
And finally I want to check if this Window EXISTS.
PIDs always changed, ok. But I haven't any ideas for now.
Maybe I'm doing some wrong? It's possible to avoid this delay issue or I must use another script-engine?
I found that WinList function has no delay. This fact shows that delay is exactly in WinExists function, when it "looks inside" a window information.
I found that "While ObjectAutoit.WinExists("",WindowHeader) Cycle" loop cycles as many times as explorer-folders windows are opened. So, WinExists cycles through ALL windows inside itself (not in my code, I see only succeeded loops). So, delay-problem is in WinExists function inside AutoItX library. And I can't trace which window causes it to delay because there is no any verbose (or I didn't find it) inside AutoitX.
Please, anybody, any suggestions will be appreciated.

Edited by poddex
Link to post
Share on other sites
  • 2 weeks later...
  • 1 month later...

i would suspect you have windows issues. when i face the needle in a haystack, i just blast the machine and install clean. all my stuff is backed up and in the cloud so it takes about 8 minutes to install windows 10 from usb

 

My resources are limited. You must ask the right questions

 

Link to post
Share on other sites

You wanted help getting auto IT to work properly on your system. And that’s the way to do it. Just because installing all your programs takes a while doesn’t matter. If you don’t want to do it then just use some other scripting language as you suggested and solve your own problem

 

But that won’t change the fact that your windows 10 image has issues and probably has more problems than you are noticing.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to post
Share on other sites
  • 3 weeks later...
On 11/20/2020 at 8:31 PM, Earthshine said:

I don't want to download your spreadsheet. you can post code here. we can dummy up our own spreadsheets. what antivirus do you use?

Same antivirus as before Windows update ūüėɬ†ESET Internet Secirity.

I updated Windows for 1909 - nothing changes, still exprerience the issue.

Yesterday evening MS didn't want update me for 2004, only for 1909 ūüėÉ

 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By HoratioCaine
      Hi, everyone.
      I have python code for kill window,  but sometimes it does not working .

      My code is :
      import subprocess import time import ctypes au3_dll = ctypes.windll.LoadLibrary(r'D:\AutoIt\AutoItX3.dll') def close_ie(title): subprocess.Popen(f"C:/Program Files (x86)/Internet Explorer/iexplore.exe https://cn.bing.com/?mkt=zh-CN") time.sleep(2) au3_dll.AU3_Opt("WinTitleMatchMode", 2) ret = au3_dll.AU3_WinKill(title, "") print(ret) if __name__ == '__main__': title = 'ŚŅÖŚļĒ - Internet Explorer' for i in range(10): close_ie(title) My expectation is that all IE windows will be closed, but there will always be a few windows still there.
      My env: win10 64bit python3.6.4 autoit v3.3.14.2  
      Any suggestions would be appreciated 
    • By WilliamasKumeliukas
      Hello everyone,
      I started this project alone in May 2020 as project in my spare time at work, I'm working for a IT company that started opening their services to residential customers few months ago and now my position in the company kind of drifted in the doom and gloom world of repetitive tasks like: Reinstallation + Configuration of Windows 10.
      The procedure is very repetitive and I started feeling like being a robot which is the main reason I started this project.
       
       
      ==============================FAQ==================================
      1. Q: Do you want this project to be accomplished with the usage of AutoIt ONLY or 3rd party tools / Scripts (BATCH / POWERSHELL / VB) ? A: No, if I cannot find a way using AutoIt to accomplish a task I will move to my Plan B which consist of automating an 3rd party tool to accomplish the affected task until a solution is found. 2. Q: What do I get from helping/collaborating in this project? A: I will personally take the responsibility to mention you in the credits of this project. 3. Q: If I have more questions, can I ask? A: Certainly! feel free to ask any questions related to this project! 4. Q: What is the main goal of this project? A: Automating Windows 10 configuration without user interaction needed (as much as possible) ______________________________________________________________________________________________________________________________
      Current progression of the project (more will be added in future)
      ¬ę¬†Blue = Info ||¬†Yellow¬†= Unfinished/Untested ||¬†Purple¬†= Could be better¬†|| Green¬†= Done ||Red = Not Yet Started¬†¬Ľ
      ***Very early Stage ***
      Connect Network Attached Storage(NAS) (Work but missing configuration in GUI - AutoIt only)
      Download & Install up to 600+ softwares (Tested & Working - using 3rd party tool + 50/50 Powershell/AutoIt)
       Auto prediction of Apps name of text typed inside input (Tested & Working - AutoIt Only)
      Change OEM Informations (Tested & Working -  AutoIt)
      Disable hibernation (Tested & Working - AutoIt only)
      Change Computer Name (Work but require testing - AutoIt only) 
      Show Computer Information and Smart status on GUI (Tested & Working - AutoIt Only)
      Change .pdf / .pdfxml from Edge to Adobe Reader DC (Tested & Working - using 3rd party tool)
      Change Edge to Google Chrome as Default Browser (Tested & Working - using 3rd party tool)
      Windows Updater (Seems to work but require further testing - AutoIt only)
      Install Office 365 / 2013 + Activation (To Do)
      Add L2TP VPN Configuration for Windows Built-in VPN (To Do)
      Save / Load tasks configuration profile in (.ini file) to avoid repeating same configuration twice (In progress - AutoIt Only)
      (EXPERIMENTAL) Install Apps from Microsoft Store with UIAutomation UDF made by @junkew(Work if you know what your doing)
         P.S: Installing Apps from Microsoft Store will require usage of  UIA spy tool made by @LarsJ which you can download & learn how to use it on UIA Spy Tool thread.
      ***  If this project interest you, Reply here This will greatly help me to see if you'd like this project to become real  ***
      ______________________________________________________________________________________________________________________________
      Best Regards,
      ~WilliamasKumeliukas
    • By beautifulsoup
      Hi All,
      I'm not sure if its possible that I'm trying to achieve, I've looked into https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/AutoIt3Wrapper.html and such resources for help, but I cant really find the answer to my question.
      So upon compiling the script in SciTE, the exe file is given a Description under file Properties>Details. I understand, that  one can enter info manually there and it can even implement the version automatically with each compilation.
       
      What I'm trying to achieve is to somehow include the "@ScriptName" in the Details>File Description Field. But as I see no variable can be taken after "#" in this case.
       
      Do You think its achievable? (Win 10)
       
      Much obliged for taking time on reading this.
       
      Kind Regards,
      Brave


    • By IndianSage
      Hi,
      I have a specific situation:
      Is it possible to run autoit script/.exe as a task which in turn is automating a desktop user interactive application on windows 10 where user will not be logged in - at best I can get user locked? 
      If so how will this work or is there any tool available to do this?
      I am trying z-cron task scheduler but it runs only some part also I tried windows 10 task schedule with option to allow task to run which is user interactive type but that too does not work.
      Looking forward to hear from you to help me out of this situation.
      Thanks,
       
    • By therks
      So I have no example code currently because I'm not sure where to even start.
      We're using the parental controls on the computer and the kids each have their own user profiles with limited time. The problem we're encountering is when their time runs out, or if they just hit Win+L and leave the computer, their games are still running in the background. I was hoping to write up a quick AutoIt script and throw it in a recurring scheduled task to just sign off any of the kid's profiles that's not currently active. I found some suggestions to use "query session" and then "logoff [user]" in the command line (which it seems I could easily automate with AutoIt) but that's only available on Win Pro and this system is running Home (and I even tried copying the query.exe from a Pro system but it errors out). Is there some AutoIt equivalent to the query and logoff functions or am I stuck?
      Edit: I'm adding some clarification to exactly what I'm hoping to get out of this script.
      I'd like to setup a scheduled task that runs outside of the current user (perhaps under the SYSTEM account?) in case NO user is currently active, that will detect which users are currently signed in. If users from a predefined list are not currently active, sign them off entirely.
      So let me give two examples:
      Example #1:
      - I am logged in, but not active (I left my browser open and locked the computer) - Nephew A is logged in, but not active (his time ran out while his game was running and the computer auto-locked) - Nephew B is logged in, and currently playing a game When script runs, ignore my profile (leave it signed in), log out Nephew A (closing his game), and ignore Nephew B because he's actively using the computer. Example #2:
      - I am logged in - Nephew A is logged in - Nephew B is logged in - No users are currently active (Windows is sitting on the choose user / sign in screen) When script runs, ignore my profile, log out Nephew A and Nephew B.  
      I would perceive pseudo code, going as such:
      $aChildUsers = [ 'NephewA', 'NephewB' ] $aUserList = GetSignedInUsers() For $i = 0 to UBound($aUserList)-1 If Not UserIsActive($aUserList[$i]) Then For $j = 0 to UBound($aChildUsers)-1 If $aUserList[$i] = $aChildUsers[$j] Then LogOffUser($aUserList[$i]) Next EndIf Next Obviously, GetSignedInUsers(), UserIsActive(), LogOffUser() are not real functions. What I'm searching for is something of their equivalent.
      Thanks for your time!
×
×
  • Create New...