Jump to content

Unable to Send text to IP Input Box


comtech80
 Share

Recommended Posts

Folks,

I have an issue I've been trying to solve for a while, I'm trying to add static routes in DHCP via a 121 route rule in Windows 2012 R2 is a brutal manual process and wanted to automate this via AutoIT.

 

When I use the "ControlGetText" everything displays properly in the MSG box but when I try and use "ControlSetText" or "ControlSend" the values won't display in the input box but the action comes back as successful?

Anyone able to help me with this? I'm thinking this might be an active window issue but i'm not sure.

Here is a part of my code.

 

$hWnd = WinWait("[TITLE:Add a Static Route]","", 10)
WinActivate($hWnd)

$Status = ControlSend($hWnd, "", "[CLASS:Edit; INSTANCE:4]", "192"); Does not add 192 to the text box.

Local $sTextEdit1 = ControlGetText($hWnd, "", "[CLASS:Edit; INSTANCE:1]")

ConsoleWrite ( "ControlSend Status: " &  $Status & @CRLF); Returns a Value of 1

ConsoleWrite ( "ControlGetText Value Edit1: " &  $sTextEdit1 & @CRLF);

 

Please see attachment for more info.

DHCP Static Route.jpg

Edited by comtech80
Link to comment
Share on other sites

@comtech80, do that with the route command line utility, not via GUI.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

sorry, i was in a hurry... for configuring DHCP scope from the command line, use the netsh command, instead of route. i never had to configure classless static routes myself, and i don't have adequate DHCP server at my disposal at the moment for testing - so i can't assist further, except directing you to this interesting forum post.

note that scope option 249 was re-numbered to 121 since Windows 2008, and the IPADDRESS data type should be valid. try it out.

B.T.W in general - and specifically on a server - pretty much anything that can be configured in a GUI, can be configured by a command line script.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

  • 4 weeks later...
On 11/11/2017 at 4:03 AM, orbs said:

...in general - and specifically on a server - pretty much anything that can be configured in a GUI, can be configured by a command line script.

I tend to agree, but I'd also admonish they mostly tend to be accessible via powershell (when it comes to Windows of course).

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

×
×
  • Create New...