Jump to content

Recommended Posts

Posted

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

Posted (edited)

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 : ( 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

 

Posted

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

 

Posted (edited)

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 : ( 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

 

Posted

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

Posted

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 : ( 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

 

Posted

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 : ( 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

 

Posted

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

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
×
×
  • Create New...