try the following from
E:\program files\mysql\mysql server 5.1\bin folder using cmd
net stop MySQL <-- this is to stop the mysql service
mysqld --skip-grant-tables
now keep that cmd window open and start a new cmd window and go to
E:\program files\mysql\mysql server 5.1\bin in that and run :
mysql -u root
this will give you the mysql prompt :
mysql>
in the mysql prompt execute :
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; <--- replace NEW-ROOT_PASSWORD with your password
mysql> flush privileges;
mysql> quit
now close the first cmd window as well and restart the mysql service from the service tab.