Long Arrow Right External Link angle-right Search Times Spinner angle-left

How to uninstall Office product keys?

Do you need to move your Office suite to another computer? Or you bought a new laptop and want to transfer your Office from your PC to laptop? To be able to transfer your Office license, you will need to deactivate the software from the previous device first. Unfortunately Microsoft doesn’t provide the option to uninstall product keys directly within the user interface of its software, so you will need to uninstall the software product key with the help of Command Prompt (cmd.exe).

What is Command Prompt? 


Command Prompt, also known as cmd.exe or simply cmd, is the in-built command-line console of Windows. It can be used to run various commands and scripts, to perform advanced administrative functions and to fix some types of Windows issues. 

Attention! Before uninstalling a product key, make sure the original license with the product key is safely stored somewhere (in digital or physical form) – for example, if it’s an electronic license, upload it to a secure cloud storage, send it to your email, put it on a USB drive etc. After uninstalling the software product key, it will no longer be in the system files, so you risk losing it.

How to uninstall Office product keys?

In order to open Command Prompt, go to Windows Start menu search box and type: 


When Command Prompt shows up in the list, right-click on it and choose Run as administrator. It’s essential to open cmd.exe as an administrator, otherwise some commands will not work. 


Windows might ask if you want to allow the program to make changes to your computer – click Yes and continue.

Once you have opened Command Prompt, you will need to use a command to navigate it into the folder where the licensing software of your Office is located. The command is not the same for all Office editions, so choose the combination of the Windows and Office architecture that you have from the table below: 


If you do not know the bit architecture of your Windows and Office, just try both commands for your Office.

EXAMPLE: A computer with 64-bit Windows 10 + 32-bit Office 2016 Home and Business

Wrong command: cd C:\Program Files\Microsoft Office\Office16 

Result: unsuccessfully executed command 


Correct command: cd C:\Program Files (x86)\Microsoft Office\Office16 

Result: successfully executed command 


Now that you are in the correct folder, you can continue with the product key uninstallation.

1) First check the current license status of your Office. Type the following: 

cscript ospp.vbs /dstatus

  • If the Office is activated, the result will be similar to this image: 

Line Last 5 characters of installed product key shows the last 5 symbols of the currently installed product key.

Note: Throughout the article we use blue Xson top of the original characters in the example images for security reasons.
  • If the Office is installed in trial period, it is not activated and the result will be similar to this image: 

2) To uninstall the product key from the current computer, type the following command:

cscript ospp.vbs /unpkey:XXXXX

In place of XXXXX you need to enter the last 5 characters of the product key – you’ve learned these numbers when you executed the status command in the previous step:


Once the command is executed successfully, the Office will be in an unlicensed state (deactivated) unless a new product key is installed.

Now, if you run cscript ospp.vbs /dstatus again, you will get this result: 


And you’re done! Now your Office is deactivated. You can transfer the key you just uninstalled to another computer or install another product key to the currently deactivated Office.