Fix it now
Microsoft documents 0xC004F013 as SL_E_RIGHT_NOT_GRANTED: the caller does not have permission to run the software. In practice nothing in the licence store grants the running edition the right to run, so the first job is to find out whether the store is damaged or simply empty. Those need different fixes.
cscript //nologo %windir%\system32\slmgr.vbs /dlv
cscript //nologo %windir%\system32\slmgr.vbs /rilc
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
- Read the
/dlvoutput before anything else. If it cannot describe the installed edition at all, the licence files are the problem. If it describes the edition correctly and reports no key, the store is fine and you need a key. slmgr /rilcreinstalls the licence files that ship with Windows from the system folders. Microsoft documents that it replaces matching licences in the store; it does not remove your product key.- After the reboot, install the key for the edition you are running:
cscript //nologo %windir%\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX. - Activate with
/atoand confirm with/dli.
Do not go looking for the token store to rename or delete. Microsoft documents no such procedure, the location differs between builds, and the supported repair is the sequence above.
If the store repairs and the key activates, you can stop here. If slmgr /dlv still cannot describe the edition afterwards, the next section covers what else to look at.
Why it happens
The name behind this code says more than the message does. Microsoft’s software licensing API reference documents 0xC004F013 as SL_E_RIGHT_NOT_GRANTED, described as the caller not having permission to run the software, and in one place as the policy list being empty. That is a statement about rights and policy, not about a specific missing file, and it is why the error reads so alarmingly while the machine carries on working perfectly.
Windows keeps two related things. The licence files describe every edition and channel the installation is entitled to be, and they ship with the image. The activation state records that an activation actually happened. The licensing service needs a licence granting the right, and something to prove that right was exercised. When the first is missing, damaged or simply describes nothing that covers the running edition, no right is granted and this is what you get.
It is worth knowing which codes mean what, because three of them get used interchangeably and only one of them means what people usually assume. Microsoft documents 0xC004F011 as the licence file not being installed, 0xC004F015 and 0xC004F017 as the licence not being installed, and 0xC004F008 as the licence not being found. Those are the missing-file codes. 0xC004F013 is the right not being granted, which is the outcome rather than the cause.
The licence files were removed or damaged
You have this one if slmgr /dlv returns little or nothing useful, and the machine was recently cleaned, repaired or disinfected.
- Run
slmgr /rilcfrom an elevated prompt to reinstall the system licence files. - Reboot, then run
slmgr /dlvagain and confirm the edition is now described correctly. - If it is not, run
sfc /scannowandDISM /Online /Cleanup-Image /RestoreHealth, then repeatslmgr /rilc. - Install your key with
slmgr /ipkand activate withslmgr /ato.
Microsoft documents /rilc as reinstalling all the licences stored in %SystemRoot%\system32\oem and %SystemRoot%\System32\spp\tokens, replacing matching ones in the store. That is why it is safe to try first.
An edition change was left half finished
You have this one if The machine reports an edition nobody intended, or a DISM edition conversion was interrupted.
- Check what the installation now thinks it is:
DISM /online /Get-CurrentEdition. - List the supported targets with
DISM /online /Get-TargetEditions. - Complete the conversion properly:
DISM /online /Set-Edition:<edition> /ProductKey:<key> /AcceptEula. - Where no supported target exists, reinstall from media of the edition you hold a licence for.
The store is healthy and there is simply no licence
You have this one if slmgr /dlv describes the edition correctly, reports no key, and no activation has ever succeeded on this machine.
- Check whether the device has a firmware licence before assuming it does not.
- Sign in with the Microsoft account that would hold a digital licence and check
Settings > System > Activation. - If neither exists, install a key you own and activate.
This is not a fault to repair. It is the expected state of a machine that has never been licensed, and repair commands will keep succeeding without changing anything.
The component store itself is damaged
You have this one if slmgr /rilc fails, or activation appears to succeed and reverts after a reboot.
- Run
DISM /Online /Cleanup-Image /RestoreHealthfirst, thensfc /scannow, then reboot. - Repeat
slmgr /rilconce the component store is healthy, since/rilcreinstalls from files that DISM may have just repaired. - Restart the Software Protection service, then install the key and activate.
Full reference
Which licensing code means which thing
| Code | Documented meaning | What it points you at |
|---|---|---|
0xC004F013 |
SL_E_RIGHT_NOT_GRANTED: the caller does not have permission to run the software | The outcome. Work out which of the rows below caused it |
0xC004F011 |
The licence file is not installed | A missing licence file. slmgr /rilc is the first move |
0xC004F008 |
The licence could not be found | The store cannot produce the licence the request needs |
0xC004F015 |
The licence is not installed | The SKU’s licence is absent; usually an edition problem |
0xC004F017 |
The licence is not installed | The same family, raised during activation |
Only the first of those is in this article’s record, and it is the one that is least specific. If you can get any of the others out of the machine – from slmgr /dlv, from the activation page, or from the event log – use it, because they name the failure more precisely than 0xC004F013 does.
The repair sequence, and why it is in that order
slmgr /rilcfirst. It is the narrowest operation, it reinstalls only the descriptive licences, and Microsoft documents that it leaves the product key alone.DISM /Online /Cleanup-Image /RestoreHealthnext, because it repairs the component store that/rilcreinstalls from.sfc /scannowafter DISM, not before. It repairs system files using the component store, so a damaged store makes it far less useful.- Reboot, then
slmgr /rilcagain. Running it once more after the repairs is cheap and often the step that makes the difference. - Only then install the key and activate. There is no point supplying a key to a store that cannot describe the edition.
Renaming or deleting files in the licensing store affects every licensed Microsoft product on the machine, not just Windows. Microsoft documents no procedure for doing it by hand, and the location has changed between Windows versions. Use the documented commands, and on a production server use a maintenance window.
When repair does not change anything
- Confirm the machine really is running the edition you think.
slmgr /dlvnames the product;winvernames the edition and build. They disagree more often than you would expect. - Check whether the installation is an evaluation or preview build. Neither carries a licence for the full product, and no amount of store repair invents one.
- Check the Application log for Software Protection Platform entries around the time of the failure. A service that logs errors as soon as it starts is a different problem from one that runs and refuses a request.
- Confirm the Software Protection service is running and set to start automatically with a delayed start.
- If the machine was previously activated by an unofficial tool, treat a rebuild from clean media as the safer route. Those tools modify more than the licensing state.
Do not copy licence files between machines
It gets suggested, and it produces a worse problem than the one you started with. The licences are tied to the build and edition of the installation they came from, and slmgr /rilc already reinstalls the correct ones from the local system folders at no risk. If /rilc cannot find them, the component store is the thing to repair, not another computer to raid.
When a licence is the actual fix
Once the licence store is healthy and Windows can describe its own edition again, it still needs something to activate against. If the machine has no firmware licence, no account-linked digital licence and no key you can produce, the honest reading is that it has been running without one. Arco supplies Windows 11 Pro retail keys and can read the slmgr /dlv output with you first, so the key matches the edition already installed and activates without an edition change or a reinstall. If that output shows a key already present, the fix is a repair rather than a purchase and we will say so.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
0xC004F013 |
SL_E_RIGHT_NOT_GRANTED: the caller does not have permission to run the software. Documented in the same API reference as the policy list being empty | Microsoft Learn |
0xC004F008 |
The Software Licensing Service reported that the licence could not be found | Microsoft Learn |
0xC004F011 |
The Software Licensing Service reported that the licence file is not installed | Microsoft Learn |
0xC004F002 |
Raised by the same layer while licence data is being validated. No published meaning | not published by the vendor |
0xC004E004 |
Seen when the licence found does not cover the product being activated. No published meaning; check the edition before acting on it | not published by the vendor |
Confirm the fix worked
slmgr /dlvdescribes the edition and channel correctly.- Licence Status reads Licensed and a partial product key is shown.
slmgr /xprreports permanent activation rather than a countdown.- Reboot and re-check, to prove the state was written to the store rather than held in memory.
Questions people ask about this
Does this mean Windows will stop working?
No. The wording about permission to run describes a licensing right that was not granted, not an impending shutdown. Windows moves to notification mode with a watermark and locked personalisation, and continues to boot and receive updates.
Will slmgr /rilc lose my activation?
No. Microsoft documents it as reinstalling the licences stored in the system folders and replacing matching ones in the store. It does not uninstall your product key, which is why it is the correct first step here.
Do I need to buy a licence to fix this?
Only if the machine never had one. If the store was damaged on a machine that was legitimately activated, repairing the store and reactivating costs nothing. Run slmgr /dlv first and see whether a key is present before you assume anything.
Can I copy the licence files from another computer?
No. They are tied to the build and edition they came from, and copying them between machines produces a worse problem than the one you started with. Use slmgr /rilc, which reinstalls them from this machine’s own system folders.
What is the difference between this and 0xC004F011?
0xC004F011 is documented as the licence file not being installed – a specific missing file. 0xC004F013 is documented as the right not being granted, which is what happens as a result. If you can get 0xC004F011 out of the machine, you have the more precise code and should work from that.
