Jump to content

Need to run Autoit script minimized


Banker
 Share

Recommended Posts

Im new to autoit and have made a script which i need to run minimized(only tray icon showing)

The script looks like this

pt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

Run('C:\Program Files\QPR 7\Utilities\wlt.exe')

WinWait("QPR Product Activation Wizard - Welcome Page","")

If Not WinActive("QPR Product Activation Wizard - Welcome Page","") Then WinActivate("QPR Product Activation Wizard - Welcome Page","")

WinWaitActive("QPR Product Activation Wizard - Welcome Page","")

Send("{ENTER}")

WinWait("QPR Product Activation Wizard - License Agreement","")

If Not WinActive("QPR Product Activation Wizard - License Agreement","") Then WinActivate("QPR Product Activation Wizard - License Agreement","")

WinWaitActive("QPR Product Activation Wizard - License Agreement","")

Send("{ALTDOWN}a{ALTUP}{ENTER}")

WinWait("QPR Product Activation Wizard - Customer Information","")

If Not WinActive("QPR Product Activation Wizard - Customer Information","") Then WinActivate("QPR Product Activation Wizard - Customer Information","")

WinWaitActive("QPR Product Activation Wizard - Customer Information","")

Send("{ENTER}")

WinWait("QPR Product Activation Wizard - Activate Licenses","")

If Not WinActive("QPR Product Activation Wizard - Activate Licenses","") Then WinActivate("QPR Product Activation Wizard - Activate Licenses","")

WinWaitActive("QPR Product Activation Wizard - Activate Licenses","")

Send("{ENTER}")

WinWait("QPR Product Activation Wizard - Activation Method","")

If Not WinActive("QPR Product Activation Wizard - Activation Method","") Then WinActivate("QPR Product Activation Wizard - Activation Method","")

WinWaitActive("QPR Product Activation Wizard - Activation Method","")

Send("{ENTER}")

WinWait("QPR Product Activation Wizard - Finish","")

If Not WinActive("QPR Product Activation Wizard - Finish","") Then WinActivate("QPR Product Activation Wizard - Finish","")

WinWaitActive("QPR Product Activation Wizard - Finish","")

Send("{ENTER}")

Im pretty new to scripting so bare over with me :-)

Link to comment
Share on other sites

Im new to autoit and have made a script which i need to run minimized(only tray icon showing)

The script looks like this

pt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

Run('C:\Program Files\QPR 7\Utilities\wlt.exe')

WinWait("QPR Product Activation Wizard - Welcome Page","")

If Not WinActive("QPR Product Activation Wizard - Welcome Page","") Then WinActivate("QPR Product Activation Wizard - Welcome Page","")

WinWaitActive("QPR Product Activation Wizard - Welcome Page","")

Send("{ENTER}")

WinWait("QPR Product Activation Wizard - License Agreement","")

If Not WinActive("QPR Product Activation Wizard - License Agreement","") Then WinActivate("QPR Product Activation Wizard - License Agreement","")

WinWaitActive("QPR Product Activation Wizard - License Agreement","")

Send("{ALTDOWN}a{ALTUP}{ENTER}")

WinWait("QPR Product Activation Wizard - Customer Information","")

If Not WinActive("QPR Product Activation Wizard - Customer Information","") Then WinActivate("QPR Product Activation Wizard - Customer Information","")

WinWaitActive("QPR Product Activation Wizard - Customer Information","")

Send("{ENTER}")

WinWait("QPR Product Activation Wizard - Activate Licenses","")

If Not WinActive("QPR Product Activation Wizard - Activate Licenses","") Then WinActivate("QPR Product Activation Wizard - Activate Licenses","")

WinWaitActive("QPR Product Activation Wizard - Activate Licenses","")

Send("{ENTER}")

WinWait("QPR Product Activation Wizard - Activation Method","")

If Not WinActive("QPR Product Activation Wizard - Activation Method","") Then WinActivate("QPR Product Activation Wizard - Activation Method","")

WinWaitActive("QPR Product Activation Wizard - Activation Method","")

Send("{ENTER}")

WinWait("QPR Product Activation Wizard - Finish","")

If Not WinActive("QPR Product Activation Wizard - Finish","") Then WinActivate("QPR Product Activation Wizard - Finish","")

WinWaitActive("QPR Product Activation Wizard - Finish","")

Send("{ENTER}")

Im pretty new to scripting so bare over with me :-)

You will only have the tray icon. You have no gui so there's no need to worry about minimising it.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Link to comment
Share on other sites

Please Xplain a bit more

Allow me to show you.

If you use Control* functions which do not need active windows then you can minimize as well as use other options to do your actions.

This is a modification incomplete and needs the ControlIDs for the ControlClicks. Hopefully you can get that data with AutoIt Info Tool. Note that AutoItMacrogenerator within Scite is worth using for generating a script from scratch for tasks like this as it records using Control* functions.

$pid = Run('"' & @ProgramFilesDir & '\QPR 7\Utilities\wlt.exe"')
If WinWait("QPR Product Activation Wizard - Welcome Page", "", 60) Then
    WinSetState("QPR Product Activation Wizard - Welcome Page", "", @SW_MINIMIZE)
    ControlClick("QPR Product Activation Wizard - Welcome Page", "", "")
    ;
    WinWait("QPR Product Activation Wizard - License Agreement")
    ControlClick("QPR Product Activation Wizard - License Agreement", "", "")
    ControlClick("QPR Product Activation Wizard - License Agreement", "", "")
    ;
    WinWait("QPR Product Activation Wizard - Customer Information")
    ControlClick("QPR Product Activation Wizard - Customer Information", "", "")
    ;
    WinWait("QPR Product Activation Wizard - Activate Licenses")
    ControlClick("QPR Product Activation Wizard - Activate Licenses", "", "")
    ;
    WinWait("QPR Product Activation Wizard - Activation Method")
    ControlClick("QPR Product Activation Wizard - Activation Method", "", "")
    ;
    WinWait("QPR Product Activation Wizard - Finish")
    ControlClick("QPR Product Activation Wizard - Finish", "", "")
EndIf
ProcessWaitClose($pid)

:D

Edit: Added a pair of missing quotes.

Edited by MHz
Link to comment
Share on other sites

Allow me to show you.

If you use Control* functions which do not need active windows then you can minimize as well as use other options to do your actions.

This is a modification incomplete and needs the ControlIDs for the ControlClicks. Hopefully you can get that data with AutoIt Info Tool. Note that AutoItMacrogenerator within Scite is worth using for generating a script from scratch for tasks like this as it records using Control* functions.

$pid = Run('"' & @ProgramFilesDir & '\QPR 7\Utilities\wlt.exe"')
If WinWait("QPR Product Activation Wizard - Welcome Page", "", 60) Then
    WinSetState("QPR Product Activation Wizard - Welcome Page", "", @SW_MINIMIZE)
    ControlClick("QPR Product Activation Wizard - Welcome Page", "", "")
    ;
    WinWait("QPR Product Activation Wizard - License Agreement")
    ControlClick("QPR Product Activation Wizard - License Agreement", "", "")
    ControlClick("QPR Product Activation Wizard - License Agreement", "", "")
    ;
    WinWait("QPR Product Activation Wizard - Customer Information")
    ControlClick("QPR Product Activation Wizard - Customer Information", "", "")
    ;
    WinWait("QPR Product Activation Wizard - Activate Licenses")
    ControlClick("QPR Product Activation Wizard - Activate Licenses", "", "")
    ;
    WinWait("QPR Product Activation Wizard - Activation Method")
    ControlClick("QPR Product Activation Wizard - Activation Method", "", "")
    ;
    WinWait("QPR Product Activation Wizard - Finish")
    ControlClick("QPR Product Activation Wizard - Finish", "", "")
EndIf
ProcessWaitClose($pid)

:D

Edit: Added a pair of missing quotes.

Thx for all help i tried your script, it minimizes the windows, but does not finish
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...