Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

How to Clear CMOS

0.00/5 (No votes)
27 Nov 2003 1  
The two line code to clear cmos password or to clear whole cmos

Introduction

Add the following code in an MFC application or make Win32 Dynamic link library and then add the code. It works fine on Win9x only, it was not tested on XP/NT and hope it won't work on NT based tech.

The intension of this code is only for educational purposes. This code is for those who are too lazy to open their cabinet and remove the batter. No remote CMOS clearing routine is specified, so no questions should be posted for the same.  

How To Use It

Come on, you know how to... 

int __stdcall Clear_Cmos( )
{
_outp(0x70,0x2E);   //password will get cleared
_outp(0x71,0xFF); 

/* if you want to clear whole CMOS
use following code
for(int i=0;i<256;i++)  // whole cmos will get cleared
{
   _outp(0x70,i);
   _outp(0x71,i); 
}
*/
return 0;
}

History

  • 27th November, 2003: Initial post

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here