Nathanrr Posted March 10, 2017 Share Posted March 10, 2017 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 More sharing options...
Subz Posted March 10, 2017 Share Posted March 10, 2017 Just use the Network UDF (see below), for example: #RequireAdmin #include "Network.au3" _EnableDHCP("Ethernet") Link to comment Share on other sites More sharing options...
Nathanrr Posted March 10, 2017 Author Share Posted March 10, 2017 11 minutes ago, Subz said: Just use the Network UDF (see below), for example: #RequireAdmin #include "Network.au3" _EnableDHCP("Ethernet") ty its working great, but i still wonder why my script is not working Link to comment Share on other sites More sharing options...
Subz Posted March 10, 2017 Share Posted March 10, 2017 Because you require #RequireAdmin at the top of your script Link to comment Share on other sites More sharing options...
Nathanrr Posted March 10, 2017 Author Share Posted March 10, 2017 2 minutes ago, Subz said: Because you require #RequireAdmin at the top of your script still not working with admin , but if i run the script twice without closing the windows he opens in first time it works .. Link to comment Share on other sites More sharing options...
Subz Posted March 10, 2017 Share Posted March 10, 2017 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 More sharing options...
Nathanrr Posted March 10, 2017 Author Share Posted March 10, 2017 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now