Không cần phải cài đặt bất cứ phần mềm nào, đây là cách tìm Windows Product Key

Không cần phải cài đặt bất cứ phần mềm nào, đây là cách tìm Windows Product Key

Giả sử bạn đang có ý định cài lại Windows, tuy nhiên bạn lại không biết hoặc không nhớ Product key để kích hoạt Windows sau khi cài đặt xong và bạn không thể kích hoạt được hệ điều hành vừa mới cài.

Dưới đây là 3 cách đơn giản giúp bạn tìm lại Product key của mình.

1. Sử dụng Powershell để tìm Product key của bạn 

1. Mở Notepad trên máy tính của bạn.

2. Sao chép và dán đoạn text dưới đây vào file Notepad:

function Get-WindowsKey {

    ## function to retrieve the Windows Product Key from any PC

    ## by Jakob Bindslet (jakob@bindslet.dk)

    param ($targets = ".")

    $hklm = 2147483650

    $regPath = "Software\Microsoft\Windows NT\CurrentVersion"

    $regValue = "DigitalProductId"

    Foreach ($target in $targets) {

        $productKey = $null

        $win32os = $null

        $wmi = [WMIClass]"\\$target\root\default:stdRegProv"

        $data = $wmi.GetBinaryValue($hklm,$regPath,$regValue)

        $binArray = ($data.uValue)[52..66]

        $charsArray = "B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9"

        ## decrypt base24 encoded binary data

        For ($i = 24; $i -ge 0; $i--) {

            $k = 0

            For ($j = 14; $j -ge 0; $j--) {

                $k = $k * 256 -bxor $binArray[$j]

                $binArray[$j] = [math]::truncate($k / 24)

                $k = $k % 24

            }

            $productKey = $charsArray[$k] + $productKey

            If (($i % 5 -eq 0) -and ($i -ne 0)) {

                $productKey = "-" + $productKey

            }

        }

        $win32os = Get-WmiObject Win32_OperatingSystem -computer $target

        $obj = New-Object Object

        $obj | Add-Member Noteproperty Computer -value $target

        $obj | Add-Member Noteproperty Caption -value $win32os.Caption

        $obj | Add-Member Noteproperty CSDVersion -value $win32os.CSDVersion

        $obj | Add-Member Noteproperty OSArch -value $win32os.OSArchitecture

        $obj | Add-Member Noteproperty BuildNumber -value $win32os.BuildNumber

        $obj | Add-Member Noteproperty RegisteredTo -value $win32os.RegisteredUser

        $obj | Add-Member Noteproperty ProductID -value $win32os.SerialNumber

        $obj | Add-Member Noteproperty ProductKey -value $productkey

        $obj

    }

}

3. Lưu file Notepad lại thành 1 tên bất lý có phần đuôi mở rộng là ".ps1" trên màn hình Desktop của bạn để dễ dàng tìm kiếm.

Chẳng hạn như bạn có thể đặt tên là GetProductKey.ps1.

đặt tên là GetProductKey.ps1

4. Mở Powershell dưới quyền Admin bằng cách nhập "powershell" vào khung Search trên Start Menu hoặc Start Screen rồi nhấn tổ hợp phím Ctrl + Shift + Enter để mở Powershell dưới quyền Admin.

5. Kích hoạt thực thi các tập tin Local mà không cần digitally signed bằng cách nhập câu lệnh dưới đây vào cửa sổ Powershell:

Set-ExecutionPolicy RemoteSigned

Nhấn Enter để thực thi câu lệnh.

NHập câu lệnh

6. Tiếp theo bạn nhập tiếp câu lệnh dưới đây:

Import-Module C:\Users\Winaero\Desktop\GetProductKey.ps1; Get-WindowsKey

Lưu ý:

Trong câu lệnh trên, thay đổi đường dẫn file GetProductKey.ps1 mà bạn đã lưu.

7. Lúc này Product key của bạn sẽ được hiển thị trên màn hình.

Product key

Ngoài ra bạn có thể tham khảo chi tiết hơn các bước thực hiện tìm Product key bằng Powershell trong video dưới đây:

2. Tìm Product key bằng cách sử dụng Command Prompt

Đầu tiên bạn nhấn tổ hợp phím Windows + X để mở Menu Power User hoặc kích chuột phải vào nút Start ở góc dưới cùng bên trái Windows 10/8, sau đó chọn tùy chọn Command Prompt (Admin) để mở Command Prompt dưới quyền Admin.

Tiếp theo nhập câu lệnh dưới đây vào cửa sổ Command Prompt rồi nhấn Enter:

wmic path softwarelicensingservice get OA3xOriginalProductKey

Lúc này trên màn hình sẽ hiển thị Product key của bạn.

Tìm Product key bằng cách sử dụng Command Prompt

3. Sử dụng Windows Registry để tìm Product key

Để tìm Product key của bạn bằng Windows Registry, đầu tiên bạn mở Notepad trên máy tính của mình.

Tiếp theo, sao chép và dán script dưới đây vào Notepad và lưu file Notepad này lại là productkey.vbs:

Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))

Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
Do
Cur = Cur * 256
Cur = Key(x + KeyOffset) + Cur
Key(x + KeyOffset) = (Cur \ 24) And 255
Cur = Cur Mod 24
x = x -1
Loop While x >= 0
i = i -1
KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
If (((29 - i) Mod 6) = 0) And (i <> -1) Then
i = i -1
KeyOutput = "-" & KeyOutput
End If
Loop While i >= 0
ConvertToKey = KeyOutput
End Function

Sau khi đã hoàn tất quá trình lưu file Notepad, bạn chỉ cần click vào file đó và trên màn hình xuất hiện cửa sổ popup hiển thị Product key của bạn. Bạn có thể sao chép và lưu lại Product key để sử dụng trong những trường hợp cần thiết.

Product key

Tham khảo thêm một số bài viết dưới đây:

Chúc các bạn thành công!

Cập nhật tin tức công nghệ mới nhất tại fanpage Công nghệ & Cuộc sống

Nguồn tin:

 

Tham gia bình luận