2025-03-14 21:59:59 -06:00
# slmgr.vbs
> Install, activate, and manage Windows licenses.
2026-08-06 22:19:46 -06:00
> Use `cscript` to run this program as a CLI, or `wscript` as a GUI.
> Note: This command may override, deactivate, and/or remove your current Windows license, so please proceed cautiously.
2025-03-14 21:59:59 -06:00
> More information: <https://learn.microsoft.com/windows-server/get-started/activation-slmgr-vbs-options>.
- [d]isplay the current Windows [l]icense [i]nformation:
2026-08-06 22:19:46 -06:00
`cscript slmgr.vbs /dli`
2025-03-14 21:59:59 -06:00
- [d]isplay the ins[t]allation [i]D for the current device. Useful for offline license activation:
2026-08-06 22:19:46 -06:00
`cscript slmgr.vbs /dti`
2025-03-14 21:59:59 -06:00
- Display the current license's e[xp]i[r]ation date and time:
2026-08-06 22:19:46 -06:00
`cscript slmgr.vbs /xpr`
2025-03-14 21:59:59 -06:00
- [i]nstall a new Windows license [p]roduct [k]ey. Requires Administrator privileges and will override the existing license:
2026-08-06 22:19:46 -06:00
`cscript slmgr.vbs /ipk {{product_key}}`
2025-03-14 21:59:59 -06:00
- [a]c[t]ivate the Windows product license [o]nline. Requires Administrator privileges to do so:
2026-08-06 22:19:46 -06:00
`cscript slmgr.vbs /ato`
2025-03-14 21:59:59 -06:00
2026-02-18 06:55:01 -07:00
- [a]c[t]ivate the Windows [p]roduct license offline. Requires Administrator privileges and a Confirmation ID provided by Microsoft Product Activation Center:
2025-03-14 21:59:59 -06:00
2026-08-06 22:19:46 -06:00
`cscript slmgr.vbs /atp {{confirmation_id}}`
2025-03-14 21:59:59 -06:00
- [c]lear the current license's [p]roduct [k]e[y] from the Windows Registry. This will not deactivate or uninstall the current license, but prevents the key from being stolen by malicious programs in the future:
2026-08-06 22:19:46 -06:00
`cscript slmgr.vbs /cpky`
2025-03-14 21:59:59 -06:00
- [u]ninstall the current license (by its [p]roduct [k]ey):
2026-08-06 22:19:46 -06:00
`cscript slmgr.vbs /upk`