How to Activate Windows 11 Via CMD (Command Prompt)?
Activating your copy of Windows 11 is essential to unlock all features, receive updates, and ensure your system remains secure and fully functional. While most users activate Windows through the Settings app, there is also a powerful and efficient way to do it using the Command Prompt (CMD). This method is especially useful for advanced users, IT professionals, or anyone troubleshooting activation issues.
In this guide, you will learn how to activate Windows 11 using CMD in a clear, step-by-step manner.
Requirements and Preparation Before Activating Windows 11 Using CMD
Before you begin the activation process, it is important to make sure everything is ready.
- First, you must have a genuine Windows 11 product key. This key is usually a 25-character code that comes with your device or is purchased separately. Many laptops and desktops from brands like HP, Dell, Lenovo, and ASUS already include a pre-installed license embedded in the motherboard.
- Second, ensure your system is connected to the internet. Activation requires communication with Microsoft servers unless you are using a volume licensing setup in a corporate environment.
- Third, confirm that you are logged in as an administrator. Without admin privileges, CMD will not allow you to run activation commands.
- Finally, make sure your system date and time are correct. Incorrect settings can cause activation failures.
How to Activate Windows 11 Via CMD (Command Prompt)

To activate Windows 11 using Command Prompt, open CMD as an administrator, enter your valid product key using the command slmgr /ipk your product key, then activate Windows by running slmgr /ato. Ensure your device is connected to the internet for successful activation.
For computers from HP, Dell, Lenovo, or ASUS, the product key is often embedded in the BIOS or UEFI firmware. In these cases, Windows may activate automatically once connected to the internet. Using CMD can help verify or manually trigger activation if needed.
Step 1: Launch Command Prompt as Administrator
To begin, you need to open the Command Prompt with administrative privileges. This is a critical step because activation commands require elevated access.
Start by clicking on the Start menu and typing “Command Prompt” in the search bar. When the result appears, do not click it immediately. Instead, right-click on it and choose Run as administrator. A User Account Control prompt may appear asking for permission. Click Yes to proceed.
Once opened, you will see a black window with text. This is the Command Prompt interface. At the top of the window, it should say “Administrator: Command Prompt”. If it does not, close it and repeat the process.
This step ensures that you have the necessary permissions to run system-level commands without restrictions.
Step 2: Check Current Activation Status
Before entering a product key, it is helpful to check whether your Windows is already activated or not.
In the Command Prompt window, type the command slmgr /xpr and press Enter. After a few seconds, a small dialog box will appear showing the activation status of your system.
If your Windows is already activated, it will display a message indicating that the machine is permanently activated. If it is not activated, you will see a message stating that activation is required.
This step helps you avoid unnecessary actions and gives you a clear understanding of your system’s current state.
Step 3: Enter Your Product Key
Now it is time to enter your valid Windows 11 product key.
In the Command Prompt, type the command slmgr /ipk XXXXX XXXXX XXXXX XXXXX XXXXX, replacing the Xs with your actual 25-character product key. Make sure you type the key correctly, including hyphens.
After pressing Enter, you should see a confirmation message stating that the product key has been installed successfully. If you receive an error, double-check the key for mistakes or ensure that it matches your Windows edition.
This step links your system to a valid license and prepares it for activation.
Step 4: Activate Windows Using CMD
Once the product key has been installed, you can proceed with activation.
In the same Command Prompt window, type slmgr /ato and press Enter. This command tells Windows to contact Microsoft’s activation servers and verify your product key.
If everything is correct and your internet connection is stable, you will see a message confirming that Windows has been activated successfully.
If activation fails, the system may display an error code. In such cases, verify your internet connection, check your product key, or ensure that your Windows edition matches the key.
Step 5: Verify Activation Again
After completing the activation process, it is a good idea to confirm that everything worked correctly.
Type slmgr /xpr again and press Enter. The system should now display a message confirming that Windows is permanently activated.
This final check ensures that your system is properly licensed and ready to use without limitations.
FAQs
Is activating Windows 11 via CMD safe?
Yes, using CMD is completely safe as long as you use legitimate commands and a valid product key provided by Microsoft.
Can I activate Windows 11 without a product key?
No, you need a valid product key or a digital license linked to your Microsoft account for activation.
What if my product key does not work?
Make sure the key matches your Windows edition. If the issue persists, contact Microsoft support for assistance.
Do I need the internet for activation?
Yes, online activation requires an internet connection. Offline activation is only available in specific enterprise scenarios.
Does CMD activation work on all PCs?
Yes, the method works on all Windows 11 devices regardless of brand, including HP, Dell, Lenovo, and ASUS systems.
