Jump to content
Sign in to follow this  
faustf

controlsend and windows 10 why not work?

Recommended Posts

hi guys

i have a script  like this,  in windows 7 work perfect , in windows 10 not  work  , some one can explain me  why ??'

#include <Array.au3>
#include <MsgBoxConstants.au3>
Global $aGPathFoto= FileReadToArray (@ScriptDir & "\TEMP\PathFoto.txt")
 
Local $ctrl = 0
 
While 1
    Local $hWnd = WinWait("[CLASS:#32770]", "", 10)
    If WinExists("[CLASS:#32770]") Then
 
        If $ctrl < 2 Then
 
            ControlSend($hWnd, "Choose File to Upload", "[CLASS:Edit; INSTANCE:1]",  $aGPathFoto[0]&"{Enter}")
 
            Exit
 
            $ctrl += 1
        Else

            ExitLoop
        EndIf
    EndIf

WEnd

$aGpathfoto = C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg

Share this post


Link to post
Share on other sites

MS .NET frammework issue ?

 

https://en.wikipedia.org/wiki/Microsoft_UI_Automation

 

And #RequireAdmin if the application 

[CLASS:#32770]

Is runned as admin.

 

 

Edited by caramen

My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

yes  work  , but not  work i explain much better

i  have  a  first exe  ,it run like administrator , and  it   call

a   exe

#include <Array.au3>
#include <MsgBoxConstants.au3>
#RequireAdmin
Global $aGPathFoto= FileReadToArray (@ScriptDir & "\TEMP\PathFoto.txt")
 
Local $ctrl = 0
 
While 1
    Local $hWnd = WinWait("[CLASS:#32770]", "", 10)
    If WinExists("[CLASS:#32770]") Then
 
        If $ctrl < 2 Then
 
            ControlSend($hWnd, "Choose File to Upload", "[CLASS:Edit; INSTANCE:1]",  $aGPathFoto[0]&"{Enter}")
 
            Exit
 
            $ctrl += 1
        Else

            ExitLoop
        EndIf
    EndIf

WEnd

the problem is  if  i run  with double click over second exe it  works  , but if  the second is  call by first  (both have #RequireAdmin) not work  o_O

 

Share this post


Link to post
Share on other sites

Look : 

If you got rigths issue: 

You have to understand this : 

When you start a script without rights: You CANNOT do automation to a software Runned as Admin/Domain Admin (RunAs) with rights.

When you start your script with #RequireAdmin : It will ask you the rights at the start of the script. All the application opened by your script will have these rights Nothing else. 

So everything that you will automate with this case have to got the same permitions/rights or no rights needed at all to be automated.

 

When you start your script with #RequireAdmin : You can automate all admin application and all user application that does not need rights. 

 

Check all that. Come back if you still have issue. Hope i am clear enouth becose my english need improvement ;p.

 

 

 

 

You got somthing reaaaaaly easy to do to check about how rights are working on a soft. 

 

Just attach handle and try play with windows. Just with WinMove. Non-Admin rights based software will be able to be moved without #RequireAdmin

The oposite is true.

Edited by caramen

My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

yes  i know  this  therfore i thin is very strange  in pratical with first  exe  (run in administration mode ) open a site and arrive to  upload  foto ,  before open a foto upload (and  script go in pause )  i run a  external second exe  the second exe have the same   requireadmin (and obviusly if the first exe run like admin ..) at  this point  remain in open foto  and see the  2 exe  run and  also  ersult of control send  give me 1   but not  write nothing 0_0

Share this post


Link to post
Share on other sites

Oh... Wow... Never thougth about this... 

 

A script with #RequireAdmin that is running an other script with #RequireAdmin 

Hmmmm.... 

 

You probably have to let this #RequireAdmin on both script and have the behavior prompt disabled in the registry. Tio be sure abou the UAC prompt. But this is not your issue right ? 

 

becose when you explain it. It s realy similar about rights requirements. 


My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Give it a try on that: 

 

Try shellExecut and then try winmove. < I am sure this one wont work

 

 

Try RunAs Domain admin and try again to move < I am sure this one will work


My video tutorials : HERE ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

i resolve  ,  the script  work correct also   i use a timing  for  wait open and  this timing not respect  time  now  work correct :)

Share this post


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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Danyfirex
      Hello!!!  
      In the past I had problems adding an application as a default for an extension in Windows 10. (It was easy in windows 7 using Registry) But since Windows 8 It requires to do some steps more. I wrote a tool (in other programming language) months ago for handling it. But now I just want to share an AutoIt version.
       
      Check on GitHub.
       
       
      Saludos
    • By WilliamasKumeliukas
      Hi,
      I started this project alone in May 2020 as project in my spare time at work, I'm working for a IT compagny that's started opening their services to residential customers few months ago and now my position in the company kinda drifted in the doom and gloom world of repetitive tasks like: Reinstallation 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 (BAT / CMD / VBS) ? 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 responsability 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 might 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) (Tested & Working - AutoIT only)
      Install Adobe Reader DC, 7zip, Google Chrome (Tested & Working - using 3rd party tool)
      Change OEM Information (Tested & Working - contains both AutoIT version and CMD script)
      Disable ScreenSaver (Require testing AutoIT only)
      Change Computer Name (Require testing AutoIT only) 
      Change Default Browser (Work - using 3rd party tool)
      Change .pdf / .pdfxml from Edge to Adobe Reader DC (AutoIT only)
      Change Edge to Google Chrome as Default Browser (Tested & Working - using 3rd party tool)
      Windows Updates (Currently working on it - AutoIT only)
      Install Office 
      Activate Office (Tested on 2010 & Working - CMD Script)
      Pin to taskbar Excel, Outlook, Word, Chrome (Tested & Working - using 3rd party tool)
      GUI currently featuring the following options 
      - TreeView to check case of desired tasks
      -  Redirect ConsoleWrite with timestamp messages in richedit (errors shown in red text)
                 *** To Do ***
       - Read informations needed for tasks like: OEM, ComputerName, NAS user/password etc... from a file
       - ListView for Windows Updates
       - Probably more
       
      ***  If this project interest you, Reply here This will greatly help me to see if you'd like this project to become real  ***
      ______________________________________________________________________________________________________________________________
      2020.09.21 Update: Since this topic reached over 200+ views without a single interest shown by community, pm me and i'll share with you W10 Configurator script  
       
      Best Regards,
      ~WilliamasKumeliukas
    • By Jgladden
      Dan - thanks for all that you do - this stuff is great. 
      Hoping you can assist with an issue we are having now that we have moved to Windows 10/Server 2016. The Chrome interactions were working flawlessly until moving over. Now my code fails when attempting to create the session. As you can see, our Chrome install is not in a standard location but I have validated the path to the binary. I have attached some detail below including system info, console output and the chrome log detail. I have tried several recommendations that have seen in various forums but none have made a difference
      Any assistance you can give would be greatly appreciated. 
      Thanks in advance, 
      chrome_Details.txt
    • By poddex
      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.
    • By Jahar
      Hi All,
      Please help me on how to fetch date/time of last windows 10 system restore point using autoit? Basically its about querying the last restore point.
×
×
  • Create New...