如何在Windows 7上用batch file更改MAC地址?

我想通过简单的点击(使用batch file)来更改我的无线设备的MAC地址。 我怎么做到这一点? 它需要select一个随机的MAC地址。

Solutions Collecting From Web of "如何在Windows 7上用batch file更改MAC地址?"

我不确定这是否完全正确,但会是这样的:

在.reg文件中

REGEDIT4 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0009] "NetworkAddress"="000011112222" 

0009将不得不改变以匹配您的适配器的地址。

从批处理文件运行下一个命令:

 reg add HKLM SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0001] /v NetworkAddress /d 0123456789AB 

用您的接口号码和0123456789AB替换0001与所需的网络地址。

下面是在Windows 7上更改MAC地址的定义批处理文件:就像这个问题的(误导性)标题一样,它缺少随机部分(作为一个练习,将set / p替换为生成器标签的调用)。 现在方便,所有这种拒绝服务的复兴…

 :: Change MAC script by bobdynlan, release 1 :: For each network adapter it will list RegPath, GUID, Name, previous modified MAC if exists :: Then you can input new MAC, clear previous MAC by inputting 0 or skip by pressing [Enter] :: You can paste directly from ipconfig or wireshark because : < > { } [ ] - ( ) . will be filtered out :: Note that for wireless in Win7 standard drivers has to start with 02... 06... 0A... 0E... @ECHO OFF &SET /A RLINE=1 &SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION FOR /F "tokens=3*" %%I IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards" /S^|FINDSTR /I /L "REG_SZ"') DO ( SET /A RLINE+=1 &SET /A PARITY=!RLINE!^%%2 IF !PARITY! EQU 0 (SET "ADAPTERGUID=%%I") ELSE ( SET "ADAPTERNAME=%%I %%J" FOR /F %%A IN ('REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}" /F "!ADAPTERGUID!" /D /E /S ^|FINDSTR /I /L /V "Linkage"^|FINDSTR /I /L "\\Class\\"') DO SET "REGPATH=%%A" CLS &echo Change MAC script by bobdynlan, release 1 &echo. &echo RegPath = !REGPATH! &echo GUID = !ADAPTERGUID! &echo Adapter name = !ADAPTERNAME! REG QUERY "!REGPATH!" /V "NetworkAddress" 2>&1 |FINDSTR /I /L "NetworkAddress" SET "CHANGEMAC=" &SET "RESETMAC=" echo. &echo Enter MAC address for this adapter [0 to reset it] or press [Enter] to skip: &SET /P "CHANGEMAC=" IF "!CHANGEMAC!"=="0" (SET "RESETMAC=Y" &SET "CHANGEMAC=") ELSE SET "RESETMAC=" IF DEFINED CHANGEMAC SET "CHANGEMAC=!CHANGEMAC: =!" &FOR %%I IN (: ^< ^> { } [ ] - ^( ^) .) DO SET "CHANGEMAC=!CHANGEMAC:%%I=!" IF DEFINED CHANGEMAC REG ADD "!REGPATH!" /F /V NetworkAddress /T REG_SZ /D !CHANGEMAC! >nul 2>&1 IF DEFINED RESETMAC REG DELETE "!REGPATH!" /F /V NetworkAddress >nul 2>&1 )) IF DEFINED CHANGEMAC FOR /F "tokens=2,4*" %%I IN ('netsh interface show interface^|FINDSTR /I /L "Enabled"') DO ( netsh interface set interface %%J DISABLED netsh interface set interface %%J ENABLED ) 

ChangeMAC.bat

您可以使用Technitium MAC地址更改器命令行来执行此操作。 只有你需要把它安装在目标机器上。

有一个changeMac.bat文件。

 @echo off netsh interface set interface "Local Area Connection" disable reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0007 /v NetworkAddress /d 002622D90EFC /f netsh interface set interface "Local Area Connection" enable echo Ok, enjoy it :) 

有三个地方可能需要更改: Local Area Connection002622D90EFC注意 :你必须打开注册表来找出你应该改变0007参数。 Mac地址有一些规则:第二位必须是这些数字中的一个:0 2 6 A E.

有一个你可能需要的recoverMac.bat。

 @echo off netsh interface set interface "Local Area Connection" disable reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0007 /v NetworkAddress /f netsh interface set interface "Local Area Connection" enable echo Ok,enjoy it :) 
  1. 批处理脚本自己一个CMD线注册表编辑器。
  2. 更改注册表键值,如链接在这里: http : //www.windowsreference.com/networking/how-to-change-mac-address-in-windows-registry/