Jump to content

Newbie At Work


Guest ringster23
 Share

Recommended Posts

Guest ringster23

I am trying to automate the setup of a new dial-up connection in Windows 2000. I have tried using AutoIt but can't seem to figure out how to get around the problem of the titles not changing as you walk through the wizard. I am using AU_spy.exe to determine the Window titles but can't quite figure out what I should be using for the text parameter to differ between the windows or any other method to differ between the seperate windows in the wizard. Any help you could provide to automate this process would be greatly appreciated.

Link to comment
Share on other sites

In AU_spy.exe there is a section called

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

Any text under this section is visible and can be used.

eg.

Assuming the connection wizard has started..

WinWaitActive("New Connection Wizard","Welcome to the New Connection Wizard")
ControlClick("New Connection Wizard","Welcome to the New Connection Wizard","Button6")
WinWaitActive("New Connection Wizard","&Connect to the Internet")
ControlCommand ( "New Connection Wizard", "", "Button2", "CHECK", "" )
ControlClick("New Connection Wizard","&Connect to the Internet","Button6")

This scripts clicks the NEXT button on the first window, wait for the next window, sets the second radio button to check, clicks the NEXT button.

Hope it helps

Nobby

CheersNobby

Link to comment
Share on other sites

Guest ringster23

I tried this and the wizard seems to exit after each step, but the script is paused and waiting for the next step. ??????

;Setting up the dial-in connection

run ( "control.exe ncpa.cpl", "")

WinWait("Network and Dial-up Connections","")

If Not WinActive("Network and Dial-up Connections","") Then WinActivate("Network and Dial-up Connections","")

WinWaitActive("Network and Dial-up Connections","")

Send ( "{ALT}" )

Send ( "F" )

Send ( "N" )

WinWait("Network Connection Wizard","Welcome to the Network Connection Wizard")

If Not WinActive("Network Connection Wizard","Welcome to the Network Connection Wizard") Then WinActivate("Network Connection Wizard","Welcome to the Network Connection Wizard")

WinWaitActive("Network Connection Wizard","Welcome to the Network Connection Wizard")

ControlClick ("Network Connection Wizard","Welcome to the Network Connection Wizard", "Button3")

WinWait("Network Connection Wizard","Dial-up to &private network")

If Not WinActive("Network Connection Wizard","Dial-up to &private network") Then WinActivate("Network Connection Wizard","Dial-up to &private network")

WinWaitActive("Network Connection Wizard","Dial-up to &private network")

ControlCommand ("Network Connection Wizard", "Dial-up to &private network", "Button1", "CHECK", "")

ControlClick ("Network Connection Wizard", "Dial-up to &private network", "Button8")

WinWait("Network Connection Wizard","Type the phone number of the computer or network")

If Not WinActive("Network Connection Wizard","Type the phone number of the computer or network") Then WinActivate("Network Connection Wizard","Type the phone number of the computer or network")

WinWaitActive("Network Connection Wizard","Type the phone number of the computer or network")

ControlCommand ("Network Connection Wizard", "Type the phone number of the computer or network", "Button1", "UNCHECK", "")

ControlSetText ("Network Connection Wizard", "Type the phone number of the computer or network", "Edit2", "123-456-7891")

ControlClick ("Network Connection Wizard", "Type the phone number of the computer or network", "Button9")

WinWait("Network Connection Wizard","You may make this connection available to all users")

If Not WinActive("Network Connection Wizard","You may make this connection available to all users") Then WinActivate("Network Connection Wizard","You may make this connection available to all users")

WinWaitActive("Network Connection Wizard","You may make this connection available to all users")

ControlClick ("Network Connection Wizard","You may make this connection available to all users", "Button1")

ControlClick ("Network Connection Wizard","You may make this connection available to all users", "Button13")

WinWait("Network Connection Wizard","Completing the Network Connection Wizard")

If Not WinActive("Network Connection Wizard","Completing the Network Connection Wizard") Then WinActivate("Network Connection Wizard","Completing the Network Connection Wizard")

WinWaitActive("Network Connection Wizard","Completing the Network Connection Wizard")

ControlSetText ("Network Connection Wizard","Completing the Network Connection Wizard", "Edit1", "dial-in to network")

ControlCommand ("Network Connection Wizard","Completing the Network Connection Wizard", "Button1", "CHECK", "")

ControlClick ("Network Connection Wizard","Completing the Network Connection Wizard", "Button16")

Link to comment
Share on other sites

;Setting up the dial-in connection

run ( "control.exe ncpa.cpl", "")

WinWait("Network and Dial-up Connections","")

If Not WinActive("Network and Dial-up Connections","") Then WinActivate("Network and Dial-up Connections","")

WinWaitActive("Network and Dial-up Connections","")

Send ( "{ALT}" )

Send ( "F" )

Send ( "N" )

WinWait("Network Connection Wizard","Welcome to the Network Connection Wizard")

If Not WinActive("Network Connection Wizard","Welcome to the Network Connection Wizard") Then WinActivate("Network Connection Wizard","Welcome to the Network Connection Wizard")

WinWaitActive("Network Connection Wizard","Welcome to the Network Connection Wizard")

ControlClick ("Network Connection Wizard","Welcome to the Network Connection Wizard", "Button3")

Last line, ControlClick.... Button3. If you have a look in the AU_spy window, you will notice that Button3 is a hidden control that corresponds to the "finish" button.

The "back" button is "button1", the "Next" button is "button2".

Same applies for most of the "Wizards" windows.

Cheers

CheersNobby

Link to comment
Share on other sites

Guest ringster23

Last line, ControlClick.... Button3. If you have a look in the AU_spy window, you will notice that Button3 is a hidden control that corresponds to the "finish" button.

The "back" button is "button1", the "Next" button is "button2".

Same applies for most of the "Wizards" windows.

Cheers

<{POST_SNAPBACK}>

Thanks this worked great.
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...