Fix it now
These are Windows Installer errors rather than Kaspersky ones. Microsoft publishes 1721 as a program required for the install being unable to run – and the message itself names the action, location and command – and 1327 as the installer resolving a path to a drive that is not present. Neither says anything about your licence.
sc query msiserver
msiexec /i "C:\Users\Public\Downloads\kaspersky.exe" /l*v "%TEMP%\kav-install.log"
- Read the 1721 dialog properly before doing anything. Microsoft’s published message includes Action, location and command, and that names the step that failed.
- Remove any other antivirus or security suite with its vendor’s own removal tool, not through Settings, then reboot.
- Reboot again if Windows is waiting on an update or a pending file rename. Setup cannot complete over the top of one.
- Copy the installer to a local folder, right-click it and choose Run as administrator. Do not run it from a network share or a mapped drive.
- If the error names a drive letter, reconnect that drive if it still exists, or move the affected user folder back to a local path before retrying.
- If a previous Kaspersky installation is stuck on the machine, remove it with Kaspersky’s own removal utility and reboot.
1327 names the drive in the message. That letter is being referenced by a redirected user folder or a stored install path, and the quickest legitimate workaround is to map something to that letter temporarily and remove the mapping afterwards.
If setup completes and the product opens, you are done. If not, the next section explains what setup is doing when it stops and which of these codes belongs to which obstacle.
Why it happens
Installing a security suite is not a file copy. Setup registers kernel-mode components, installs a file-system filter driver, creates services that start before you sign in, and writes registry keys ordinary accounts cannot touch. Windows Installer drives those steps through custom actions, and a custom action that cannot run is what 1721 reports.
The important detail about 1721 is one people skip: Microsoft’s published message text is not just “a program could not be run”. It ends with “Action: [2], location: [3], command: [4]”, and the installer fills those in. The dialog is telling you which step failed and what it tried to execute. Reading it turns a generic failure into a specific one, and it is free.
1327 is a different animal and much more specific. Microsoft publishes it as “Invalid Drive: [2]”. Something in the environment resolves to a drive letter that is not present – most often a user folder such as Documents or Desktop that was redirected to a mapped network drive or a removable disk that has since gone. Windows Installer resolves the path, finds nothing, and stops.
The remaining three numbers are supporting evidence rather than separate problems. 1401 is “Could not create key: [2]. System error [3].” – a permissions answer, and the system error number in the message is the part to read. 1627 is ERROR_FUNCTION_FAILED, the function failed during execution. 27300 is a Kaspersky setup identifier with no published meaning; treat it as the installer’s own report that one of its stages did not complete.
Another security product is still on the machine
You have this one if Setup fails at the same point every time, and another antivirus appears in Installed apps or in Windows Security as a registered provider.
- Download the removal tool published by the other product’s vendor.
- Run it, let it finish, and reboot when it asks.
- Confirm in Windows Security, Virus and threat protection that no unexpected provider remains.
- Run the Kaspersky installer as administrator and let it complete.
Do this even where the other product appears already uninstalled. It is the leftovers, not the application, that block setup.
A path points at a drive that is not there
You have this one if The message is 1327 and names a specific drive letter.
- Reconnect the drive if it still exists. Plugging it back in or restoring the network mapping resolves it immediately.
- If the drive is gone for good, move the affected user folder back to a local path using its own Location tab in Properties, which is the supported way to change where it lives.
- As a temporary measure, map any share or folder to the missing letter with
substor a drive mapping, run setup, then remove it. - Sign out and back in, then run setup again.
Editing the shell folder values in the registry by hand is the route most articles reach for and the one most likely to leave a profile unable to find its own Desktop. Move the folder properly instead.
Setup cannot run with the rights it has
You have this one if 1721 or 1401 on a machine where the account is not an administrator, or where a management policy restricts installation.
- Right-click the installer and choose Run as administrator, supplying administrator credentials if prompted.
- Confirm the Windows Installer service can start:
sc query msiserverfrom an elevated Command Prompt. - Read the system error number in the 1401 message; that is the actual permissions verdict.
- On a work machine, ask whoever manages it. Installer restrictions are deliberate and are not yours to bypass.
A previous Kaspersky installation is stuck
You have this one if You are reinstalling or upgrading Kaspersky and setup fails while an old version is half-removed.
- Use Kaspersky’s own removal utility to strip the previous installation, then reboot.
- Confirm no Kaspersky entry remains in Settings, Apps, Installed apps.
- Install the current version downloaded fresh rather than the installer you used last time.
Windows is mid-servicing
You have this one if There are pending updates, the machine has not been restarted in weeks, or a reboot is queued for a file rename.
- Install outstanding Windows updates and perform a genuine restart rather than a shutdown.
- Retry setup before changing anything else.
- If it fails again, capture a verbose log and read it backwards from the rollback.
Full reference
What each number is published as
| Code | Microsoft’s published text | How to read it |
|---|---|---|
1721 |
There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Action: [2], location: [3], command: [4] | The dialog names the failing action. Read it before troubleshooting |
1327 |
Invalid Drive: [2] | A path resolves to a drive that is not present |
1401 |
Could not create key: [2]. System error [3]. | Permissions on the named key. The system error number is the verdict |
1627 |
ERROR_FUNCTION_FAILED – the function failed during execution | A failure report, not a cause |
27300 |
Not published by Kaspersky | A Kaspersky setup stage did not complete |
Getting a verbose log
Where the package is an MSI, a verbose log turns a generic failure into a named failing action. Read it from the end backwards: the rollback is at the bottom and the last thing that failed is immediately above it.
msiexec /i "<package>.msi" /l*v "%TEMP%\kav-install.log"
Search the log for “Return value 3”, which is Windows Installer’s marker for the action that ended the installation. Everything after that point is cleanup.
Removal tools, and why an ordinary uninstall is not enough
- A security suite’s filter driver attaches to the file system and is not removed by deleting the program.
- Self-protection is designed to prevent anything modifying the product’s files, including an uninstaller that fails part way.
- Registrations with the Windows Security Center outlive the files that created them.
- Every major antivirus vendor publishes a dedicated removal tool for exactly this reason. Use the one belonging to the product you are removing, not a generic cleaner.
- If two other suites have been on the machine over the years, assume both left something and run both tools.
The drive-letter case in more detail
1327 turns up most often on machines where Documents, Desktop or Downloads were redirected to a network share or an external disk. The redirection is recorded per user, the drive is no longer attached, and every installer that asks Windows where Documents lives gets an answer pointing at nothing. The supported repair is to open the folder’s Properties, use the Location tab and move it back to a local path, which relocates the contents as well as the pointer. That is slower than editing a registry value and it is the version that leaves a working profile behind.
Things not to do
- Do not turn the Windows firewall off. It does not block a local installation, and switching security off to install security software is the wrong instinct.
- Do not try to remove Microsoft Defender first. Windows moves it aside by itself once a third-party antivirus registers.
- Do not install with another suite still present on the theory that setup will sort it out. It will not, and you will then have two products that neither work nor uninstall.
- Do not run the installer from a network share or a mapped drive. Copy it locally first.
- Do not delete the previous product’s folders by hand. The files go, the services and driver registrations stay, and the replacement will refuse to install.
When setup finally completes
- Open the application and confirm it reports protection as active rather than as needing attention.
- Activate it, if you have not already, and confirm an expiry date in the future.
- Run a database update and let it finish; the first one after installation is the large one.
- Check Windows Security, Virus and threat protection, and confirm exactly one third-party provider is listed.
- Restart and confirm the product starts by itself.
When a licence is the actual fix
Nothing in this article costs money to fix; an installation failure is a configuration problem and no product installs more successfully than another. What the machine needs once setup completes is a valid activation code, because Kaspersky Premium protects nothing until it is activated. If your subscription lapsed while you were fighting the installer, Arco can supply a current Kaspersky Premium licence and confirm it matches the build you are installing and the number of devices you want covered. If you decide against a paid suite after all this, Microsoft Defender is already in Windows and needs no installation at all.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
1721 |
There is a problem with this Windows Installer package: a program required for the install could not be run. The message names the action, location and command | Microsoft Learn |
1327 |
Invalid Drive: the installer resolved a path to a drive letter that is not present on the machine | Microsoft Learn |
27300 |
A Kaspersky setup identifier seen when one of its own stages does not complete. Kaspersky publishes no meaning for it | not published by the vendor |
1401 |
Could not create key, with a system error number. The named key and that system error are the diagnosis | Microsoft Learn |
1627 |
ERROR_FUNCTION_FAILED: the function failed during execution. It reports that something failed, not why | Microsoft Learn |
Confirm the fix worked
- Kaspersky appears in Settings, Apps, Installed apps with the version you intended.
- The application opens and reports protection as active rather than as needing attention.
- Windows Security, Virus and threat protection lists Kaspersky as the registered provider with no second suite alongside it.
- A database update and a quick scan both complete.
- Restart and confirm the product starts on its own.
Questions people ask about this
Do I need to remove Microsoft Defender first?
No, and you should not try. Windows moves Defender aside automatically once a third-party antivirus registers itself with the Security Center. Only genuine third-party suites need removing.
The error names a drive I got rid of years ago. Why now?
Because 1327 fires whenever something resolves a path to that letter, and only some installers ask. A user folder redirected to a drive that no longer exists sits harmlessly until an installer asks Windows where Documents lives.
Does a failed install use up my activation code?
No. Codes are consumed at activation, not at installation. A setup that never completed has not touched your entitlement.
What does 27300 mean?
Kaspersky does not publish a meaning for it. Read it as the installer reporting that one of its own stages did not complete, and diagnose from the Windows Installer codes alongside it and from a verbose log.
Should I disable the Windows firewall while installing?
No. It does not block a local installation, and the instinct to switch security off in order to install security software is the wrong one. Deal with the rival antivirus and the installer environment instead.
