Backup Windows product key in Windows 8 (VBScript)

Introduction

This script sample shows how to get and backup Windows product key in Windows 8 or higher version.

For the scripts of Windows 10 version, please visit urls below

Scenarios

Sometimes a user may want to reinstall operating system, but he does not know the current Windows product key. This script can solve that.

Script

Step 1: Double-click the script, it will show message as following.

Step 2: Press Yes to save Windows product key to a file.

Here are some code snippets for your references.

VB Script
Edit|Remove
Current= 0 
    j = 14 
    Do 
       Current = Current* 256 
       Current = Key(j + KeyOffset) + Current 
       Key(j + KeyOffset) = (Current \ 24) 
       Current=Current Mod 24 
        j = j -1 
    Loop While j >= 0 
    i = i -1 
    KeyOutput = Mid(Maps,Current+ 11) & KeyOutput 
    Last = Current

Prerequisite 

Windows 8 or later version