参考 4 分钟· 更新于 2026-10-16
每位 Windows 管理员必备的 slmgr 命令
许可命令参考 — 安装密钥、检查状态、延长试用期和强制激活。
slmgr.vbs is built into every Windows since Vista and controls the entire licensing layer. Open Command Prompt as Administrator and use these:
| Command | What it does |
|---|---|
| slmgr /ipk <key> | Install (or replace) the product key |
| slmgr /ato | Activate online now |
| slmgr /xpr | Show expiration — confirms permanent activation |
| slmgr /dli | Display license info (edition + channel) |
| slmgr /dlv | Verbose license info — everything incl. activation ID |
| slmgr /upk | Uninstall the current product key |
| slmgr /cpky | Clear the key from registry (do before reselling a PC) |
| slmgr /rearm | Reset the evaluation timer |
| slui 3 | GUI: enter a product key |
| slui 4 | GUI: phone activation |
Typical workflows
Replace a key and activate:
slmgr /upk slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX slmgr /ato slmgr /xpr
Check what channel your license is (Retail / OEM / Volume):
slmgr /dli :: look for "Description: ... VOLUME_MAK channel" or "RETAIL channel"
Pro tip
Before deploying a purchased key, run /dli on a test machine after activation — the Description field confirms you got the license channel you paid for.