How to rebuild the Tokens.dat file when you troubleshoot Windows activation issues
When you troubleshoot Windows activation issues, you may have to rebuild the Tokens.dat file.
Applies to: Windows 10 - all editions, Windows Server 2012 R2, Windows Server 2019, Windows Server 2016
Original KB number: 2736303
Rebuild the Tokens.dat file
Open an elevated command prompt:
- Open Start menu or Start screen, search cmd.
- Right click Command Prompt in the search results, and select Run as administrator.
Type the following commands in the order in which they're presented. Press Enter after each command.
net stop sppsvc
For Windows 10, Windows Server 2016 and later versions of Windows:
For Windows 8.1 and Windows Server 2012 R2:
For Windows 8 and Windows Server 2012:
For Windows 7, Windows Server 2008 and Windows Server 2008 R2:
For Windows 8.1 that were upgraded from Windows 8, the location may still be %windir%\system32\spp\store.
ren tokens.dat tokens.bar
net start sppsvc
cscript.exe %windir%\system32\slmgr.vbs /rilc
Restart the computer.
After you rebuild theTokens.dat file, you must reinstall your product key by using one of the following methods:
At the same elevated prompt command, type the following command, and then press Enter:
cscript.exe %windir%\system32\slmgr.vbs /ipk \<product key>
Right-click My Computer, select Properties, and then select Change product key.
- You should never use the
/upkswitch to uninstall a product key. To install a product key over an existing product key, use the
- For more information about Key Management Services (KMS) client setup keys, see KMS client activation and product keys.
If you need assistance from Microsoft support, we recommend you collect the information by following the steps mentioned in Gather information by using TSS for deployment-related issues.