Open cmd(command prompt) with administrator rights
2) Type slmgr.vbs –ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx (x should be replaced by your 25 digit product key)
3) Hit enter
4) Type slmgr.vbs –ato (This will change the product key)
5) Hit enter
Another method for fixing activation error 0xC004F074
1) Start -> Run ->Type Slui 3 (Slui 4 for activating by phone)
2) Enter Product key
3) Click Activate
Other methods to try
The issue might be with corrupt system files. Run an SFC scan.
Open command prompt(with admin rights).
Type sfc /scannow
Try activating, once the scan is complete. If the scan produced errors,this might be a problem with corrupted system files that needs to be taken care of.