본문 바로가기
공부하며놀자/컴퓨터놀이

사용중인 윈도우 cd키 시리얼 SN 추출하기 알아보기

by 테너토너 2019. 7. 5.
반응형

현재 윈도우 CD키, SN 추출방법

현재 내가 사용하고 있는 윈도우 CD KEY, Serial Number, SN, 키를 알아야 할 때가 있다.

컴퓨터 구매와 함께 딸려 온 윈도우는 정품이고 license key가 있지만 main board 귀속이다. 즉 license key를 추출한다고 해서 다른 PC에 사용해서 정품 인증을 받을 수가 없다는 뜻이다.

 

Retail 버전은 윈도우 license key를 따로 구매한 것이라 어디 귀속이 아니라 필요에 따라 한 pc에서 사용하다가 pc가 고장 나면 다른 pc에서 그 license key로 정품 인증해서 사용이 가능하다.

 

1) 현재 사용하고 있는 윈도우 키가 OEM인지 Retail인지 확인하기.

1. 관리자 권한으로 command prompt 실행

2. slmgr /dlv 입력 후 엔터. 

3. Windows Script Host가 뜨기까지 시간이 좀 걸릴 수 있으니 여유롭게 기다린다.

 


2) 원래 있던 윈도우 키 확인하기. (아마 OEM 키일 듯)

1. command prompt 실행

 

 


3) 현재 사용하고 있는 윈도우 키 추출하기.

1. 아래 텍스트를 글어서 메모장에 붙여 넣고 check.vbs라고 이름을 바꾼다.

2. check.vbs라고 더블 클릭한다. 기본적으로 Microsoft Windows Base Script Host로 실행되어야 하는데 간혹 메모장으로 그냥 텍스트로 열리는 PC들이 존재한다.

2.1 현재 check.vbs가 저장되어 있는 폴더 경로에서 command prompt를 실행한다.  경로에 cmd라고 입력 후 엔터.

2.2 command promprt에 wscript.exe “check.vbs”라고 입력 후 엔터를 하면 현재 사용하고 있는 윈도우 키 전체를 확인할 수 있다.

더보기

Option Explicit
Dim objshell,path,DigitalID, Result
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
'Get ProductName, ProductID, ProductKey
ProductName = "Product Name: " & objshell.RegRead(Path & "ProductName")
ProductID = "Product ID: " & objshell.RegRead(Path & "ProductID")
ProductKey = "Installed Key: " & ConvertToKey(DigitalID)
ProductData = ProductName & vbNewLine & ProductID & vbNewLine & ProductKey
'Show messbox if save to a file
If vbYes = MsgBox(ProductData & vblf & vblf & "Save to a file?", vbYesNo + vbQuestion, "BackUp Windows Key Information") then
Save ProductData
End If
'Convert binary to chars
Function ConvertToKey(Key)
Const KeyOffset = 52
Dim isWin8, Maps, i, j, Current, KeyOutput, Last, keypart1, insert
'Check if OS is Windows 8
isWin8 = (Key(66) \ 6) And 1
Key(66) = (Key(66) And &HF7) Or ((isWin8 And 2) * 4)
i = 24
Maps = "BCDFGHJKMPQRTVWXY2346789"
Do
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+ 1, 1) & KeyOutput
Last = Current
Loop While i >= 0

If (isWin8 = 1) Then
keypart1 = Mid(KeyOutput, 2, Last)
insert = "N"
KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0)
If Last = 0 Then KeyOutput = insert & KeyOutput
End If
ConvertToKey = Mid(KeyOutput, 1, 5) & "-" & Mid(KeyOutput, 6, 5) & "-" & Mid(KeyOutput, 11, 5) & "-" & Mid(KeyOutput, 16, 5) & "-" & Mid(KeyOutput, 21, 5)
End Function
'Save data to a file
Function Save(Data)
Dim fso, fName, txt,objshell,UserName
Set objshell = CreateObject("wscript.shell")
'Get current user name
UserName = objshell.ExpandEnvironmentStrings("%UserName%")
'Create a text file on desktop
fName = "C:\Users\" & UserName & "\Desktop\WindowsKeyInfo.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set txt = fso.CreateTextFile(fName)
txt.Writeline Data
txt.Close
End Function

 

혹시 첨부 될 수도 있으니 check.vbs파일도 첨부는 해본다. 되면 위 텍스트 복사할 필요가 없음.

check.vbs
0.00MB

반응형

댓글