Sign in to follow this  
Followers 0
Banker

Need to run Autoit script minimized

8 posts in this topic

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

I have the tray icon but i also have the windows maximized. I have made a cmde file which calls for the script qpr.exe

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

WinSetState

Please Xplain a bit more

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thx for all help i tried your script, it minimizes the windows, but does not finish

I did mention incomplete script. It needs ControlIDs added to the 3rd parameter of the ControlClicks to make it work correct. :D

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  
Followers 0