palotex Posted February 27, 2008 Share Posted February 27, 2008 hi, this is my first script, i use to change the mac address of my network address without rebooting the computer. it works on my pc expandcollapse popup#include <GuiListView.au3> #include <guitab.au3> #Include <GuiListBox.au3> #include <GuiEdit.au3> #include <array.au3> if not Ping("www.google.com",250) Then MsgBox(0,"","Sin conexion?????") Exit EndIf Global $nuevamac = InputBox ("Introduce la nueva MAC","Recuerda que son de este formato 0016E6DAED73") StringUpper ($nuevamac) if StringLen($nuevamac) <> 12 then MsgBox(0,"--------------ATENCION-----------","ERROR.... Tienes que poner 12 caracteres hexadecimales") exit EndIf if not StringIsXDigit($nuevamac) Then MsgBox(0,"-------------ERROR-------------","La MAC , SOLO debe de ser hexadecimal 0-9 , A-F") Exit EndIf Run("RunDll32.exe shell32.dll,Control_RunDLL ncpa.cpl") sleep(1000) $hWnd = WinGetHandle("Network Connections" or "Conexiones de red") $title = "Network Connections" $title2 = "Conexiones de Red" $hListView = ControlGetHandle($hWnd, "", "SysListView321") $idx = _GUICtrlListView_FindInText($hListView, $title or $title2) _GUICtrlListView_SetItemSelected ($hListView, $idx) _GUICtrlListView_SetItemFocused ($hListView, $idx) ControlSend($hWnd, "", "SysListView321", "{SPACE}") ControlSend($hWnd, "", "SysListView321", "{Enter}") winclose("") ControlClick("", "", "[CLASSNN:Button3]") winclose("") ControlClick("", "", "[CLASSNN:Button1]") winclose("") $hWnd3 = WinGetHandle("Ethernet Controller") $systab = ControlGetHandle($hWnd3, "", "SysTabControl321") $ItemCount = _GUICtrlTab_GetItemCount($systab) send("{TAB}") send("{TAB}") send("{TAB}") send("{TAB}") Send("{RIGHT}") winwait("") $hListView = ControlGetHandle($hWnd3, "", "ListBox1") $items = _GUICtrlListBox_GetCount($hListView) sleep(1500) send("{tab}") send("{down}") send("{down}") send("{down}") send("{down}") send("{down}") send("{down}") send("{down}") $heditbox = ControlGetHandle($hWnd3, "", "Edit1") _GUICtrlEdit_SetText($heditbox, $nuevamac) ControlClick("", "", "[CLASSNN:Button3]") Link to comment Share on other sites More sharing options...
James Posted February 27, 2008 Share Posted February 27, 2008 Instead of clicking through there is a simpler way of doing it using the command prompt. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
palotex Posted February 27, 2008 Author Share Posted February 27, 2008 Instead of clicking through there is a simpler way of doing it using the command prompt.and the simplier way it's? Link to comment Share on other sites More sharing options...
James Posted February 27, 2008 Share Posted February 27, 2008 Click here Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
palotex Posted February 27, 2008 Author Share Posted February 27, 2008 Click hereyes, but rebooting the pcwith the script , no need rebootingsorry about my english..... Link to comment Share on other sites More sharing options...
James Posted February 27, 2008 Share Posted February 27, 2008 Look at the second post! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
palotex Posted February 27, 2008 Author Share Posted February 27, 2008 ups, i didnt read it..... Link to comment Share on other sites More sharing options...
James Posted February 27, 2008 Share Posted February 27, 2008 If you need anything you will need: RegRead/Write Run() @Comspec Have fun. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
A. Percy Posted February 27, 2008 Share Posted February 27, 2008 (edited) A long time ago, I made something like it:http://www.autoitscript.com/forum/index.php?showtopic=42018 Edited February 27, 2008 by A. Percy Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator[center]VW Bug user[/center]Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral Link to comment Share on other sites More sharing options...
SandelPerieanu Posted February 28, 2008 Share Posted February 28, 2008 try this, only for 2000, xp or 2003 server Link to comment Share on other sites More sharing options...
palotex Posted February 29, 2008 Author Share Posted February 29, 2008 try this, only for 2000, xp or 2003 serveruffffffff, it's a great work....thank you psandu.ro Link to comment Share on other sites More sharing options...
Kilhian Posted February 29, 2008 Share Posted February 29, 2008 This a the transcription in autoit of this procedureexpandcollapse popup#include <Array.au3> #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $Regkey1 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network" $i = 1 $h = 0 Dim $check1 = 0 Dim $Connexion_name[15][3] Dim $Net_adapt_sid[1] While $check1 = 0 $Subkey = RegEnumKey($Regkey1, $i) $test = RegRead($Regkey1 & "\" & $Subkey, "Class") Select Case $test = "Net" $j = 1 $check2 = 0 Do $test2 = RegEnumKey($Regkey1 & "\" & $Subkey & "\" & RegEnumKey($Regkey1 & "\" & $Subkey, $j), 1) If @error = 1 Then $check2 = 1 If $test2 = "Connection" Then $value = RegRead($Regkey1 & "\" & $Subkey & "\" & RegEnumKey($Regkey1 & "\" & $Subkey, $j) & "\Connection", "Name") Select Case @error = 0 $Connexion_name[$h][0] = $value $Connexion_name[$h][1] = RegEnumKey($Regkey1 & "\" & $Subkey, $j) $Connexion_name[$h][2] = $Subkey $h += 1 EndSelect EndIf $j += 1 Until $check2 = 1 $check1 = 1 EndSelect $i += 1 WEnd $h = 0 $combolist = "" Do If $combolist = "" Then $combolist &= $Connexion_name[$h][0] Else $combolist &= "|" & $Connexion_name[$h][0] EndIf $h += 1 Until $Connexion_name[$h][1] = "" $Form1 = GUICreate("Form1", 179, 194, 193, 125) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $Combo1 = GUICtrlCreateCombo("", 16, 69, 145, 25) GUICtrlSetData($Combo1, $combolist, "...") GUICtrlSetOnEvent($Combo1, "Combo1Change") $Input1 = GUICtrlCreateInput("", 16, 24, 145, 21) $Label1 = GUICtrlCreateLabel("Mac Address to change", 16, 4, 117, 17) $Label2 = GUICtrlCreateLabel("Network adapter", 16, 52, 147, 17) $Button1 = GUICtrlCreateButton("Change", 16, 156, 143, 25, 0) GUICtrlSetOnEvent($Button1, "Button1Click") $Input2 = GUICtrlCreateInput("", 16, 124, 145, 21) GUICtrlSetOnEvent($Input2, "Input2Change") $Label3 = GUICtrlCreateLabel("Desired Mac Address", 20, 104, 105, 17) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Button1Click() ;RegWrite($G_Reg,"NetworkAddress","REG_SZ",GUICtrlRead($Input2) ;disable, enable the adapter with netsh rundos('netsh interface set interface "'&GUICtrlRead($Combo1)&'" DISABLE') rundos('netsh interface set interface "'&GUICtrlRead($Combo1)&'" ENABLE') EndFunc ;==>Button1Click Func Combo1Change() Dim $error $h = 1 Do $Regkey2 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\" & $Connexion_name[$h - 1][2] If GUICtrlRead($Combo1) = $Connexion_name[$h - 1][0] Then $j = 1 Do $t=RegEnumKey($Regkey2, $j) $test = RegRead($Regkey2 & "\" & RegEnumKey($Regkey2, $j), "NetCfgInstanceId") $error = @error If $test = $Connexion_name[$h - 1][1] Then Global $G_Reg = $Regkey2 & "\" & RegEnumKey($Regkey2, $j) ;$s=GetAdaptersList($t) ;MsgBox(0, "", $G_Reg,1) EndIf $j+=1 Until $error=1 EndIf $h += 1 Until $Connexion_name[$h -1][1] = "" EndFunc ;==>Combo1Change Func Form1Close() Exit EndFunc ;==>Form1Close Func Input2Change(); was supposed to change xxxxxxxxxx to xx-xx-xx-xx-xx-xx,but onevent over an input box seems doesn't work if StringLen(GUICtrlRead($Input2))=2 Or StringLen(GUICtrlRead($Input2))=5 or StringLen(GUICtrlRead($Input2))=8 Or StringLen(GUICtrlRead($Input2))=11 or StringLen(GUICtrlRead($Input2))=14 Then GUICtrlSetData($Input2,GUICtrlRead($Input2)&"-") EndIf EndFunc ;==>Input2Change Link to comment Share on other sites More sharing options...
SandelPerieanu Posted February 29, 2008 Share Posted February 29, 2008 Hi,Execution time is very long with Beta 3.2.11.1.With Beta 3.2.11.1 - StdOutRead is not okhttp://www.autoitscript.com/forum/index.ph...mp;#entry478930i am waiting next version of Autoit, where Execution Time of StdOutRead is ok. Link to comment Share on other sites More sharing options...
gift8188 Posted October 10, 2008 Share Posted October 10, 2008 try this, only for 2000, xp or 2003 server太有帮助了,谢谢啦! Link to comment Share on other sites More sharing options...
AlmarM Posted October 10, 2008 Share Posted October 10, 2008 太有帮助了,谢谢啦!"太有帮助了,谢谢啦!"What does he say? AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
SoulA Posted October 10, 2008 Share Posted October 10, 2008 My version Here no restart required Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted October 10, 2008 Share Posted October 10, 2008 "太有帮助了,谢谢啦!"What does he say? AlmarMAccording to Google: "Very helpful, thank you!" Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
gift8188 Posted October 14, 2008 Share Posted October 14, 2008 "太有帮助了,谢谢啦!"What does he say? AlmarMthis is chinese . Link to comment Share on other sites More sharing options...
AlmarM Posted October 14, 2008 Share Posted October 14, 2008 Ahhhhhhhh That exlpains alot AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. 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