Jump to content

Scripts not working on Windows 7 ?


T0m4s
 Share

Recommended Posts

I GET IT RUNNING ...

Very amazing. I have to start the compiled script as Administrator.

I am working in an active directory controlled company network. My account already have local administration rights, but it seems thats not enough.

Thanks for help anyway!

Edited by T0m4s
Link to comment
Share on other sites

Glad you got it working :D

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

It looks like your setup application runs as administrator while an AutoIt script without "#RequireAdmin" runs with standard permissions. That's why the script can't access the controls.

But I don't understand why the ControlClick returns 1 (success) when it can't acess the controls :huh:

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

Not to be a buzzkill or anything... But the USB driver is packaged with Nullsoft.

NSIS installers recognize /S for silent installation, /NCRC to suppress the CRC (verification) step, and /D=dir to specify the "output directory", which is where the program will be installed. These options are case-sensitive, so be sure to type them in upper case.

I didn't check the other one tho.

Link to comment
Share on other sites

I always prefer to use the installation switches. That's more reliable than clicking through the installation process using AutoIt.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

You should ALWAYS use the installation switches when available.

Don't waste time trying to automate the GUI controls for a setup when there's already a system in place to automate the install.

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

Amen!

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

I too had to use these options to perform an unattended install of a program which did not accept command line inputs. I'll include it here as it may be helpful to you.

#NoTrayIcon

AutoItSetOption("WinTitleMatchMode", 2)

Run("setup.exe", @ScriptDir)
WinWait("PetraPro Setup")
Sleep(1000)
ControlClick("PetraPro Setup", "&Next >", 1)
Sleep(1000)
ControlClick("PetraPro Setup", "&Yes", 6)
Sleep(1000)
ControlClick("PetraPro Setup", "&Next >", 1)
Sleep(1000)
ControlSetText("PetraPro Setup", "", 303, "Serial Number Goes Here - Redacted")
Sleep(1000)
ControlClick("PetraPro Setup", "&Next >", 1)
Sleep(1000)
ControlClick("PetraPro Setup", "&Next >", 1)
Sleep(1000)
ControlClick("PetraPro Setup", "&Next >", 1)
Sleep(1000)
ControlClick("PetraPro Setup", "&Next >", 1)
Do
$Finish = ControlGetHandle("PetraPro Setup", "Finish", 1)
Sleep(1000)
Until $Finish <> ""
ControlClick("PetraPro Setup", "Finish", 1)

Exit
Link to comment
Share on other sites

I too had to use these options to perform an unattended install of a program which did not accept command line inputs.

If you're going to do that, you might as well perform a WinWait() on the inner text of each window instead of Sleep()ing.

Sleeping for 1 second can still allow you to miss the window if it decides to lockup for an additional half a second before hitting the next screen. And also some screens move faster than 1 second.

So just performing a WinWait() targeting inner-text removes any additional delay, and also doesn't attempt to continue if it pauses for a longer-than-not duration of time.

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

It's also a good idea to wait for the control to be present, and enabled. Then focus on it prior to performing an action. Doing that solved almost all my issues with automation applications.

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...