Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RequireAdmin
- #include <ButtonConstants.au3>
- #include <ComboConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("Form1", 298, 61, 192, 124)
- $Label1 = GUICtrlCreateLabel("Adaptor :", 8, 8, 47, 17)
- $Combo1 = GUICtrlCreateCombo("Wi-Fi", 64, 8, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
- $Button1 = GUICtrlCreateButton("Change", 216, 8, 75, 25)
- $Label2 = GUICtrlCreateLabel("Ipv4 Now:", 8, 40, 53, 17)
- $Label3 = GUICtrlCreateLabel("Label3", 64, 32, 228, 17)
- GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman")
- GUICtrlSetColor(-1, 0xFF0000)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- GUICtrlSetData($Label3, @IPAddress1)
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $Button1
- GUICtrlSetData($Label3, 'Change.')
- Run('netsh interface ipv4 set address name="' & GUICtrlRead($Combo1) & '" static 192.168.1.' & Random(5,255,1) & ' 255.255.255.0 192.168.1.1', @WorkingDir, @SW_HIDE)
- Sleep(100)
- While StringLeft(@IPAddress1,3) = "127"
- Sleep(100)
- GUICtrlSetData($Label3, GUICtrlRead($Label3) & '.')
- WEnd
- GUICtrlSetData($Label3, @IPAddress1)
- EndSwitch
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement