comtech80 Posted November 9, 2017 Share Posted November 9, 2017 (edited) 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. Edited November 9, 2017 by comtech80 Link to comment Share on other sites More sharing options...
orbs Posted November 10, 2017 Share Posted November 10, 2017 @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 More sharing options...
comtech80 Posted November 10, 2017 Author Share Posted November 10, 2017 @orbs, Thanks! But how does the Route command work with DHCP on the server? I thought this could only be done on workstations? Link to comment Share on other sites More sharing options...
orbs Posted November 10, 2017 Share Posted November 10, 2017 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 More sharing options...
spudw2k Posted December 6, 2017 Share Posted December 6, 2017 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). Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF 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