#RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=..\..\..\..\..\..\Mes Images\logo\Ico\divers\tux.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include #include #include #Include #include #include #Include Opt("GuiOnEventMode", 1) Opt('MustDeclareVars', 1) Global Const $SS_RIGHT = 2 Global Const $SS_LEFT = 0 ;~ Global $WinShell= ObjCreate("shell.application") Global $Configs[50][7] Global $gui, $ConfigList, $ProfilName, $CARD, $IPWS, $MASK, $GATE, $DNS1, $DNS2, $ToolTip, $IsDHCP, $ok, $dns3, $dns4 Dim $Apply, $GetCurrent, $DeleteProfil, $SaveProfil, $About Global $NetCardDescriptors[10][3] ;0 Number ;1 Name ;2 UID Descriptor _CreateGUI() While 1 Sleep(60000) WEnd Func _CreateGUI() $gui = GUICreate("Configuration IP", 250, 250) GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit") $ok = GUICtrlCreateButton("OK", 85, 212, 80, 21, 0) GUICtrlSetOnEvent(-1, "ok") GUICtrlCreateGroup("Configuration" , 5, 05, 225, 200) GUICtrlCreateLabel("IP : " , 10, 25, 80, 20, $SS_RIGHT) GUICtrlCreateLabel("Masque : " , 10, 50, 80, 20, $SS_RIGHT) GUICtrlCreateLabel("Passerelle : " , 10, 75, 80, 20, $SS_RIGHT) GUICtrlCreateLabel("DNS : " , 10, 100, 80, 20, $SS_RIGHT) GUICtrlCreateLabel("DNS 2 : " , 10, 125, 80, 20, $SS_RIGHT) GUICtrlCreateLabel("DNS 3 : " , 10, 150, 80, 20, $SS_RIGHT) GUICtrlCreateLabel("DNS 4 : " , 10, 175, 80, 20, $SS_RIGHT) $IPWS = _GUICtrlIpAddress_Create ($gui , 90, 25, 125, 20) $MASK = _GUICtrlIpAddress_Create ($gui , 90, 50, 125, 20) $GATE = _GUICtrlIpAddress_Create ($gui , 90, 75, 125, 20) $DNS1 = _GUICtrlIpAddress_Create ($gui , 90, 100, 125, 20) $DNS2 = _GUICtrlIpAddress_Create ($gui , 90, 125, 125, 20) $DNS3 = _GUICtrlIpAddress_Create ($gui , 90, 150, 125, 20) $DNS4 = _GUICtrlIpAddress_Create ($gui , 90, 175, 125, 20) GUISetState(@SW_SHOW) EndFunc func ok() Runwait ('netsh interface ip set address name=wifi source=static addr=' & _GUICtrlIpAddress_Get($IPWS) & ' mask=' & _GUICtrlIpAddress_Get($MASK) & ' gateway=' & _GUICtrlIpAddress_Get($GATE) & ' gwmetric=0', "", @SW_HIDE ) RunWait ("netsh interface ip delete dns wifi all" ,"",@SW_HIDE) RunWait ('netsh interface ip add dns wifi ' & _GUICtrlIpAddress_Get($DNS1),"",@SW_HIDE) RunWait ('netsh interface ip add dns wifi ' & _GUICtrlIpAddress_Get($DNS2),"",@SW_HIDE) RunWait ('netsh interface ip add dns wifi ' & _GUICtrlIpAddress_Get($DNS3),"",@SW_HIDE) RunWait ('netsh interface ip add dns wifi ' & _GUICtrlIpAddress_Get($DNS4),"",@SW_HIDE) exit endfunc Func _Quit() Exit EndFunc