How to rebuild the Tokens.dat file when you troubleshoot Windows activation issues

Summary
When you troubleshoot Windows activation issues, you may have to rebuild the Tokens.dat file. This article lists the steps to rebuild the Tokens.dat file.
Resolution
Windows 8 and Windows Server 2012
To rebuild the Tokens.dat file in Windows 8 or in Windows Server 2012, follow these steps:
  1. Start an elevated command prompt. To do this, follow these steps:
    1. Swipe in from the right edge of the screen, and then tap Search. Or, if you are using a mouse, point to the lower-right corner of the screen, and then click Search.
    2. In the search box, type cmd.
    3. Swipe across or right-click the displayed Command Prompt icon.
    4. Tap or click Run as administrator.
  2. Type the following commands in the order in which they are presented. Press Enter after each command.
    net stop sppsvc

    cd %windir%\ServiceProfiles\LocalService\AppData\Local\Microsoft\WSLicense

    ren tokens.dat tokens.bar

    net start sppsvc

    cscript.exe %windir%\system32\slmgr.vbs /rilc
  3. Restart the computer.
Windows 7 and Windows Server 2008 R2
To rebuild the Tokens.dat file in Windows 7 or in Windows Server 2008 R2, follow these steps:
  1. Start an elevated command prompt. To do this, follow these steps:
    1. Click Start, and then type cmd in the search box.
    2. Right-click cmd, and then click Run as Administrator.
  2. Type the following commands in the order in which they are presented. Press Enter after each command.
    net stop sppsvc

    cd %windir%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform

    ren tokens.dat tokens.bar

    net start sppsvc

    cscript.exe %windir%\system32\slmgr.vbs /rilc
  3. Restart the computer.
Windows Vista and Windows Server 2008
To rebuild the Tokens.dat file in Windows Vista or in Windows Server 2008, follow these steps:
  1. Start an elevated command prompt. To do this, follow these steps:
    1. Click Start, and then type cmd in the search box.
    2. Right click cmd, and then click Run as Administrator.
  2. Type the following commands in the order in which they are presented. Press Enter after each command.
    net stop slsvc

    cd %windir%\serviceprofiles\networkservice\appdata\roaming\microsoft\softwarelicensing

    ren tokens.dat tokens.bar

    net start slsvc

    cscript.exe %windir%\system32\slmgr.vbs /rilc
  3. Restart the computer.
More information
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, click Properties, and then click Change product key.
Notes
  • You should never use the /upk switch to uninstall a product key. To install a product key over an existing product key, use the /ipk switch.
  • For more information about KMS client setup keys, go to the following Microsoft TechNet website: 
Properties

Article ID: 2736303 - Last Review: 12/27/2012 08:09:00 - Revision: 2.0

Windows Vista Enterprise, Windows 7 Enterprise, Windows Server 2008 Enterprise, Windows Server 2008 R2 Enterprise, Windows 8 Enterprise, Windows Server 2012 Standard

  • kbhowto kbexpertiseadvanced kbsurveynew KB2736303
Feedback