How to Use the Slmgr Command in Windows
Software Licensing Management Tool (slmgr) is a VBS file in Windows against which you can run commands to perform advanced Windows activation tasks.
You don't need to use Slmgr.vbs to activate Windows or change the product key, but you might need to if the normal activation process fails or if you get strange "Windows is not genuine" errors.
While the Slmgr.vbs file is stored in the System32 and SysWOW64 folders, commands that interface with the file need to be entered into Command Prompt.
TIP: Slmgr.vbs is used only for the Windows operating system. Ospp.vbs manages volume licensing for Microsoft Office products.
Slmgr Command Examples
slmgr [MachineName [username [password]]] [option]
After opening Command Prompt, enter the desired slmgr command like you see in these examples:
A regular Command Prompt can work for some of these tasks but others — ones that involve changing data and not just displaying it — require an elevated Command Prompt.