sumit Posted August 22, 2007 Share Posted August 22, 2007 Can someone suggest how i can select dynamic ip settings and dynamic dns settings through code. Any suggestion would be appreciated. Link to comment Share on other sites More sharing options...
martin Posted August 22, 2007 Share Posted August 22, 2007 Can someone suggest how i can select dynamic ip settings and dynamic dns settings through code. Any suggestion would be appreciated.netsh? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
ChrisL Posted August 22, 2007 Share Posted August 22, 2007 Run('netsh interface ip set address "Local Area Connection" dhcp', "", @SW_HIDE) [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
sumit Posted August 22, 2007 Author Share Posted August 22, 2007 Run('netsh interface ip set address "Local Area Connection" dhcp', "", @SW_HIDE) Thanks a lot Any suggestions what to do if the interface name is not Local Area Connection but something else .... is there a general script that would set dynamic ip in all possible interfaces irrespective of their names ? Link to comment Share on other sites More sharing options...
ChrisL Posted August 23, 2007 Share Posted August 23, 2007 (edited) #include <array.au3>;Just to show the output you can remove this include $myAdapters = _GetNICs() If Not @error then _ArrayDisplay($myAdapters);Just to show the output you can remove this line For $i = 1 to Ubound($myAdapters) -1 Run('netsh interface ip set address "' & $myAdapters[$i] & '" dhcp', "", @SW_HIDE) Next EndIf Func _GetNICs() $colItems = "" $strComputer = "localhost" $Output="" Local $aAdapters[1] $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionID <> NULL and NetConnectionStatus <> '0'", "WQL") If IsObj($colItems) then For $objItem In $colItems $Output &= $objItem.NetConnectionID & @CRLF Next If StringRight($Output,2) = @crlf then $Output = StringTrimRight($Output,2) $aAdapters = StringSplit($Output,@crlf,1) Else SetError(1) Endif SetError(0) Return $aAdapters EndFunc Edited August 23, 2007 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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