Sign in to follow this  
Followers 0
sambalec

MS Windows informations...

7 posts in this topic

Hi, how can I find with autoit my Windows serial number, and another Windows informations ?

Thanks a lot

Sambalec

Share this post


Link to post
Share on other sites



This is for the product key, i hope it works with your windows.

What else do you need? You can get the most information with the WMI. Just search for it.

ConsoleWrite(_GetWinProductKey() & @CR)

Func _GetWinProductKey()
    Local $bKey[15]
    Local $sKey[29]
    Local $Digits[24]
    Local $Value = 0
    Local $hi = 0
    local $n = 0
    Local $i = 0
    Local $Result
 Local $RegKey = "HKLM"
 If Not @OSArch = "X86" Then $RegKey = "HKLM64"
    $binaryDPID = RegRead($RegKey & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion","DigitalProductID")
    $Test = @extended

    If Not @Compiled Then
        If $Test = 3 Then $binaryDPID = Hex($binaryDPID)
    EndIf

    $Digits = StringSplit("BCDFGHJKMPQRTVWXY2346789","")
    $binaryDPID = stringmid($binaryDPID,105,30)

    For $i = 1 to 29 step 2
        $bKey[int($i / 2)] = dec(stringmid($binaryDPID,$i,2))
    next

    For $i = 28 To 0 Step -1
        If Mod(($i + 1), 6) = 0 Then
            $sKey[$i] = "-"
        Else
            $hi = 0
            For $n = 14 To 0 Step -1
                $Value = Bitor(bitshift($hi ,- 8) , $bKey[$n])
                $bKey[$n] = int($Value / 24)
                $hi = mod($Value , 24)
            Next
            $sKey[$i] = $Digits[$hi +1]
        EndIf

    Next
    For $i = 0 To 28
        $Result = $Result & $sKey[$i]
    Next

    Return $Result
EndFunc

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

Thanks ! but I have a problem, it's show me : BBBB-BBBB-BBBB-BBBB in console

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Sure, so thanks ;)

And how can I see the windows user in autoit ?

Edited by sambalec

Share this post


Link to post
Share on other sites

thanks again!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0