大网数据广告活动
启动与系统组件

Rebuild the Tokens.dat file

· 52CE 我爱测

Describes 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.

Original KB number:   2736303

Rebuild the Tokens.dat file

  1. Open an elevated command prompt:

    1. Open Start menu or Start screen, search cmd.
    2. Right click Command Prompt in the search results, and select Run as administrator.
  2. Type the following commands in the order in which they're presented. Press Enter after each command.

    1. For Windows Server 2008 R2 and later
      net stop sppsvc

    2. For Windows Server 2008
      net stop slsvc

    3. For Windows 10, Windows Server 2016 and later versions of Windows:
      cd %windir%\system32\spp\store\2.0

      For Windows 8.1 and Windows Server 2012 R2:
      cd %windir%\system32\spp\store\2.0

      For Windows 8 and Windows Server 2012:
      cd %windir%\system32\spp\store

      For Windows 7, Windows Server 2008 and Windows Server 2008 R2:
      cd %windir%\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform

      [!NOTE] For Windows 8.1 that were upgraded from Windows 8, the location may still be %windir%\system32\spp\store.

    4. ren tokens.dat tokens.bar

    5. net start sppsvc

    6. cscript.exe %windir%\system32\slmgr.vbs /rilc

  3. Restart the computer twice

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, select Properties, and then select Change product key.

Note: 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 Key Management Services (KMS) client setup keys, see KMS client activation and product keys.

Data collection

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.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- Supported versions of Windows Server · Source date 02/12/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。