Jump to content

Changing to dynamic ip address


Recommended Posts

Hello guys .. i am really new with autoit , i am trying to make scrip that changes the ip to an dynamic ip 

ShellExecute ("C:\Windows\System32\ncpa.cpl")
WinWaitActive("Network Connections")
Send("{home}{enter}")
WinWaitActive("Ethernet 2 Status")
Send("{tab}{enter}")
WinActivate("Ethernet 2 Properties")
send("{DOWN}{DOWN}{DOWN}")

but once i get to the ethernet properties its not clicking anything ..any advice ? 

ty

Link to comment
Share on other sites

Might be just my system then, basically each system is going to be different which is why send keys usually suck imho.  For example on my system I would have to use the following for it to work, maybe you just need to add WinWaitActive("Ethernet 2 Properties") like in the example below.

#RequireAdmin
ShellExecute ("C:\Windows\System32\ncpa.cpl")
WinWaitActive("Control Panel\All Control Panel Items\Network Connections")
Send("Ethernet{enter}")
WinWaitActive("Ethernet Status")
Send("{tab}{enter}")
WinActivate("Ethernet Properties")
WinWaitActive("Ethernet Properties")
send("{DOWN}{DOWN}{DOWN}")

 

Link to comment
Share on other sites

6 minutes ago, Nathanrr said:

still not working with admin , but if  i run the script twice without closing the windows he opens  in first time  it works ..

 

6 minutes ago, Nathanrr said:

still not working with admin , but if  i run the script twice without closing the windows he opens  in first time  it works ..

Sorry my bad its works  .

ty everyone

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...