MSTechpages
  • Home
  • Knowledge Base
  • Reviews
  • Articles
  • About
Windows 10

Extracting Your Windows 10 Key

Jul 30, 2015·Dustin·Comments (2)

Estimated Reading Time: 2 min

Finding your Windows 10 key can be problematic with Windows 10. Here is a VBS script that can get your key with no issues. This script was not written by me, but has been posted in several places with no recognition of the author. If an original source is found, I will update with the author of the script.

1. Open Notepad.

2. Copy and paste the code below into Notepad.

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

3. Save as windowskey.vbs (Change the file type to “All Files”)

4. Run the file and your key will be displayed.

winkey

Related Products on Amazon
Windows 10 Pro LicenseShop on Amazon
USB Boot DriveShop on Amazon
DDR4 RAMShop on Amazon
SATA SSDShop on Amazon

MSTechPages is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. As an Amazon Associate, we earn from qualifying purchases at no extra cost to you.

#knowledge base
Written by
Dustin · Founder and Head Editor, News Poster
Sr. Cybersecurity Engineer - Microsoft MVP Windows Experience (2014-2015)

Dustin is the founder and head editor of MSTechpages. He started the site to help other users of Windows. He has been very active with helping others throughout the years, from USENET to Microsoft Answers to the latest Microsoft Communities as well as other internet forums such as Reddit. He is a Sr. System Administrator, holds several industry certifications and degrees.

View all 1500 articles by Dustin →

Related Articles

Device Manager showing the highlighted HID-compliant touch screen under Human Interface Devices Windows 10

Disable Touch Screen in Windows

Jun 24, 2026 · Dustin
Windows Command Prompt shows DISM successfully enabling the .NET Framework 3.5 feature Windows 10

Offline install of .Net Framework 3.5 using DISM

Apr 1, 2020 · Dustin
Windows Start menu open with an alphabetical app list, pinned tiles, and taskbar icons Windows 10

Disable Autohide Scrollbars

Jul 8, 2019 · Dustin

Windows Insider Builds

Beta
26220.9606
Beta (26H1)
28020.3172
Experimental
26340.9616
Experimental (26H1)
28120.3181
Experimental (Future)
29683.1000
Recent Knowledge Base Articles
  • Disable Touch Screen in Windows
  • Add “End Task” To Right Click Application on Taskbar
  • Offline install of .Net Framework 3.5 using DISM
  • Disable Autohide Scrollbars
  • Install Active Directory RSAT in Windows 10 1809 or later
  • Disable File Grouping in File Explorer
  • Forget Wireless Networks
  • Show Hidden Files & Folders
  • Enable Night Light Mode
  • How to Fix a Network Printer Showing Offline
MSTechpages

Covering Microsoft since the dial-up days, using Windows since 2.0.

Windows

  • Windows 11
  • Windows Insider
  • Canary Channel
  • Cumulative Updates

Resources

  • Knowledge Base
  • Articles
  • Reviews

Company

  • About
  • Contact
  • Privacy Policy
  • Advertise

© 2026 MSTechpages. All rights reserved.

Privacy