5,427,303 members and growing! (15,018 online)
Email Password   helpLost your password?
Web Development » Applications & Tools » CodeProject Tools     Intermediate License: The Common Development and Distribution License (CDDL)

MAC Address Changer for Windows XP/2003

By Nishant Sivakumar

A freeware program (with source code) that allows you to change the MAC ID of your network adapter
C++, Windows, MFC, VS2005, Visual Studio, Dev

Posted: 26 May 2005
Updated: 26 May 2005
Views: 231,399
Bookmarked: 65 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
43 votes for this Article.
Popularity: 7.09 Rating: 4.34 out of 5
1 vote, 2.3%
1
1 vote, 2.3%
2
3 votes, 7.0%
3
6 votes, 14.0%
4
32 votes, 74.4%
5
Fig. 1 : Screenshot of the one and only main dialog
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.

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

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)

About the Author

Nishant Sivakumar


Sitebuilder, Mvp
Nish is a real nice guy living in Atlanta, who has been coding since 1990, when he was 13 years old. Originally from sunny Trivandrum in India, he recently moved to Atlanta from Toronto and is a little sad that he won't be able to play in snow anymore.

Nish has been a Microsoft Visual C++ MVP since October, 2002 - awfully nice of Microsoft, he thinks. He maintains an MVP tips and tricks web site - www.voidnish.com where you can find a consolidated list of his articles, writings and ideas on VC++, MFC, .NET and C++/CLI. Oh, and you might want to check out his blog on C++/CLI, MFC, .NET and a lot of other stuff - blog.voidnish.com

Nish loves reading Science Fiction, P G Wodehouse and Agatha Christie, and also fancies himself to be a decent writer of sorts. He has authored a romantic comedy Summer Love and Some more Cricket as well as a programming book – Extending MFC applications with the .NET Framework.

Nish's latest book C++/CLI in Action published by Manning Publications is now available for purchase. You can read more about the book on his blog.

Despite his wife's attempts to get him into cooking, his best effort so far has been a badly done omelette. Some day, he hopes to be a good cook, and to cook a tasty dinner for his wife.
Location: United States United States

Other popular Applications & Tools articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 35 (Total in Forum: 35) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralYour Windows computer sits on the wire?memberdontknowitall5:33 9 Mar '08  
GeneralThank Youmemberfedotawa6:12 9 Sep '07  
GeneralThanks!!memberquocky71118:48 14 Aug '07  
GeneralMac address from client machinememberMaheshSankar3:59 25 Jun '07  
GeneralIdentify the computer type and mac addressmembernilketnil10:56 26 Mar '07  
QuestionLost MAC Addressmemberricdanmar12:12 18 Mar '07  
Generalmac doesn't changemembermtbusta1:46 28 Feb '07  
GeneralHow to get the MAC from HardwarememberReader Man San21:49 31 Oct '06  
GeneralRe: How to get the MAC from HardwarememberSkull_Cracker9:53 6 Mar '07  
GeneralMACAddressChanger.exe Not Working on WinXP SP2membervbusy1:01 22 Oct '06  
GeneralSome Issues [modified]memberTomM7:41 10 Aug '06  
GeneralRe: Some IssuesstaffNishant Sivakumar7:54 10 Aug '06  
GeneralThnx mate!!!memberfreakinbush3:38 5 Jul '06  
GeneralMuy Bueno, Exelentememberalexrf7411:43 16 Jun '06  
GeneralBug with multiple IP's on a MACmemberA.Tas3:58 12 May '06  
GeneralQuestion ...memberRazvan2kss11:41 9 Mar '06  
GeneralFeature requestmemberanimesonic22:26 3 Dec '05  
GeneralMac adressmemberXiko6:06 10 Nov '05  
GeneralRe: Mac adressstaffNishant Sivakumar1:56 11 Nov '05  
GeneralThanksmembervaaljapie1:11 2 Nov '05  
GeneralRe: ThanksstaffNishant Sivakumar1:56 11 Nov '05  
Generalyour code is very good!memberljx2000018:49 23 Oct '05  
GeneralRe: your code is very good!staffNishant Sivakumar1:56 11 Nov '05  
QuestionHELP Please !!sussAnonymous22:32 22 Oct '05  
AnswerRe: HELP Please !!staffNishant Sivakumar1:57 11 Nov '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 26 May 2005
Editor: Genevieve Sovereign
Copyright 2005 by Nishant Sivakumar
Everything else Copyright © CodeProject, 1999-2008
Web13 | Advertise on the Code Project