Aller au contenu
Site Communauté

edibos

Membres
  • Nbre de contenus

    1
  • Inscription

  • Dernière visite

Messages posté(e)s par edibos

  1. Bonjour,

     

    Pour info, voici un petit script VBS qui donne le numéro de Windows. Il est stocké dans la base de registre.

     

    Pour utiliser le script, copier le code ci dessous et le mettre dans un fichier texte. Puis nommé le fichier texte avec l'extension vbs (exemple "cléWindows.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 = " Clé Windows :" & chr(10) & KeyOutput
    End Function

     

    • J'aime 1
×
×
  • Créer...