Click here to Skip to main content
15,885,365 members
Articles / Desktop Programming / MFC
Article

MAC Address Changer for Windows XP/2003

Rate me:
Please Sign up or sign in to vote.
4.68/5 (64 votes)
26 May 2005CDDL3 min read 684.3K   27K   115   61
A freeware program (with source code) that allows you to change the MAC ID of your network adapter
Image 1
Fig. 1 : Screenshot of the one and only main dialog
Image 2
Fig. 2 : You can use getmac from a command prompt to list MAC Addresses of your n/w adapters

Overview

My cable ISP does something really unusual and annoying: it locks a cable modem to the N/W card's MAC address, thereby disallowing a user from either changing his network card or using a different machine. When my dad visits me, this is most inconvenient as he cannot plug his laptop into the internet and I don't have a LAN at home he can plug into. A Linuxian friend of mine suggested that I change the MAC ID, which is apparently a one-command operation on Linux-based machines.

I Googled around and found that changing the MAC under Windows involved changing certain registry values and resetting the network adapter. I barely trust my dad with his laptop, so you can imagine how I felt about trusting him to modify the registry and reset network adapters. I am not particularly crazy about coding; I do it for a living as well as an off-work hobby, but I thought it'd be a prudent idea to write a GUI application for my dad in my spare time. That's how MAC Address Changer for Windows XP/2003 came into being.

Requirements

  • Windows XP / Windows 2003

Operations

Change the MAC ID

Enter a MAC Address into the edit box and click the Change button. It validates the ID you've entered, so you cannot enter a MAC like "I am a chicken hawk" or something goofy like that.

Reset the MAC ID

This'll reset the MAC address to the adapter default.

Things to Note

  • Normally, both operations would be pretty straightforward. Sometimes though, with some network adapters, programmatic reset of the adapters will fail. In that case, you'll get a message box telling you that you'll need to manually reset the adapter.

    Image 3
  • If you don't have write-access to the HKLM registry key hierarchy, both operations fail.

    Image 4

Program Usage

The program can be used freely for commercial and non-commercial purposes.

Source Code

The source code (decently commented, I hope) has been included. I used VC++ 2005 Beta 2 (MFC dialog application without the /clr option), so you'll need that to open the project files. All the textual UI is taken from the resource, so it should be pretty easy to have versions for other languages, say German or French for instance. If anyone modifies the source code, I request that my original copyright comment headers be left intact.

Pseudo-Statutory Warning

This program may not work with some network adapters and it might cause an adapter to stop working normally if MAC IDs are incessantly changed/reset. Some network administrators might have forbidden the practice of changing MAC addresses, so you might want to check with your sys-admin before you use this program.

Conclusion

This application was written out of personal necessity and if it is useful to other people, well and good. If not, oh well, then nothing is lost anyway. The source code has been provided for interested people.

History

  • May 19, 2005: Began work on program
  • May 25, 2005: Made fixes to allow program to run on Windows 2003
  • May 27, 2005: Program (with source code) first published on The Code Project

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)


Written By
United States United States
Nish Nishant is a technology enthusiast from Columbus, Ohio. He has over 20 years of software industry experience in various roles including Chief Technology Officer, Senior Solution Architect, Lead Software Architect, Principal Software Engineer, and Engineering/Architecture Team Leader. Nish is a 14-time recipient of the Microsoft Visual C++ MVP Award.

Nish authored C++/CLI in Action for Manning Publications in 2005, and co-authored Extending MFC Applications with the .NET Framework for Addison Wesley in 2003. In addition, he has over 140 published technology articles on CodeProject.com and another 250+ blog articles on his WordPress blog. Nish is experienced in technology leadership, solution architecture, software architecture, cloud development (AWS and Azure), REST services, software engineering best practices, CI/CD, mentoring, and directing all stages of software development.

Nish's Technology Blog : voidnish.wordpress.com

Comments and Discussions

 
AnswerRe: How to get the MAC from Hardware Pin
Skull_Cracker6-Mar-07 8:53
Skull_Cracker6-Mar-07 8:53 
GeneralMACAddressChanger.exe Not Working on WinXP SP2 Pin
vbusy22-Oct-06 0:01
vbusy22-Oct-06 0:01 
GeneralSome Issues [modified] Pin
TomM10-Aug-06 6:41
TomM10-Aug-06 6:41 
GeneralRe: Some Issues Pin
Nish Nishant10-Aug-06 6:54
sitebuilderNish Nishant10-Aug-06 6:54 
GeneralThnx mate!!! Pin
freakinbush5-Jul-06 2:38
freakinbush5-Jul-06 2:38 
GeneralMuy Bueno, Exelente Pin
alexrf7416-Jun-06 10:43
alexrf7416-Jun-06 10:43 
GeneralBug with multiple IP's on a MAC Pin
A.Tas12-May-06 2:58
A.Tas12-May-06 2:58 
GeneralRe: Bug with multiple IP's on a MAC Pin
AndIosJavaC++2-Apr-10 23:55
AndIosJavaC++2-Apr-10 23:55 
Very important tip....
Thanks...
GeneralQuestion ... Pin
Razvan2kss9-Mar-06 10:41
Razvan2kss9-Mar-06 10:41 
GeneralFeature request Pin
animesonic3-Dec-05 21:26
animesonic3-Dec-05 21:26 
GeneralMac adress Pin
Xiko10-Nov-05 5:06
Xiko10-Nov-05 5:06 
GeneralRe: Mac adress Pin
Nish Nishant11-Nov-05 0:56
sitebuilderNish Nishant11-Nov-05 0:56 
GeneralThanks Pin
vaaljapie2-Nov-05 0:11
vaaljapie2-Nov-05 0:11 
GeneralRe: Thanks Pin
Nish Nishant11-Nov-05 0:56
sitebuilderNish Nishant11-Nov-05 0:56 
Generalyour code is very good! Pin
ljx2000023-Oct-05 17:49
ljx2000023-Oct-05 17:49 
GeneralRe: your code is very good! Pin
Nish Nishant11-Nov-05 0:56
sitebuilderNish Nishant11-Nov-05 0:56 
QuestionHELP Please !! Pin
Anonymous22-Oct-05 21:32
Anonymous22-Oct-05 21:32 
AnswerRe: HELP Please !! Pin
Nish Nishant11-Nov-05 0:57
sitebuilderNish Nishant11-Nov-05 0:57 
GeneralMAC ID dll option Pin
arifbustani27-Jun-05 13:44
arifbustani27-Jun-05 13:44 
GeneralThe easier way Pin
alent1-Jun-05 4:43
alent1-Jun-05 4:43 
GeneralNice! Pin
Ravi Bhavnani27-May-05 1:53
professionalRavi Bhavnani27-May-05 1:53 
GeneralRe: Nice! Pin
Nish Nishant27-May-05 2:24
sitebuilderNish Nishant27-May-05 2:24 
GeneralRe: Nice! Pin
tsurutsuru27-May-05 4:03
tsurutsuru27-May-05 4:03 
GeneralRe: Nice! Pin
Mihai Maerean31-May-05 23:06
Mihai Maerean31-May-05 23:06 
GeneralRe: Nice! Pin
cnoevil3-Jun-05 6:21
cnoevil3-Jun-05 6:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.