Sign in to follow this  
Followers 0
Francis Lennert (France)

Sorry, not directly an AutoIt question : Word SN ?

7 posts in this topic

Hello All,

I try to find where is the Word, Excel or Office SN in the Regs

I know that is not directly an AutoIt question but if someone has the answer, that would help me.

My customers allways lose their SN and or CD and I want to create a little AutoIt script which

retrieves and shows them.

Many thanks,

Francis

PS: Don't ever try to do this kind of search in Google "Serial number Word Excel" because you will have

1000000 links to Cracks Sites...

B)

Share this post


Link to post
Share on other sites



Hello All,

I try to find where is the Word, Excel or Office SN in the Regs

I know that is not directly an AutoIt question but if someone has the answer, that would help me.

My customers allways lose their SN and or CD and I want to create a little AutoIt script which

retrieves and shows them.

Many thanks,

Francis

PS: Don't ever try to do this kind of search in Google "Serial number Word Excel" because you will have

1000000 links to Cracks Sites...

B)

There are utilities that can be bought that can do this for you.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

There are utilities that can be bought that can do this for you.

Thanks for the answer.

I thought that is more easy and that a script could do that.

Have a nice day,

Francis

Share this post


Link to post
Share on other sites

Thanks for the answer.

I thought that is more easy and that a script could do that.

Have a nice day,

Francis

Searching through the registry can only find the product id and I do not know of a way to convert that to the product key without using some other utility.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

I found this on the forums.

Dim $Bin
$Bin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","DigitalProductID")

InputBox("Product Key", "Your " & @OSVERSION & " product key is:", DecodeProductKey($bin), "", -1, 100, -1, -1)


Func DecodeProductKey($BinaryDPID)
   Local $bKey[15]
   Local $sKey[29]
   Local $Digits[24]
   Local $Value = 0
   Local $hi = 0
   local $n = 0
   Local $i = 0
   Local $dlen = 29
   Local $slen = 15
   Local $Result

   $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 = $dlen -1 To 0 Step -1
       If Mod(($i + 1), 6) = 0 Then
           $sKey[$i] = "-"
       Else
           $hi = 0
           For $n = $slen -1 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

Perhaps you could modify it to do what you want or persuade someone to.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

...I found this on the forums...

I think that credit for this script goes to bcording:

http://www.autoitscript.com/forum/index.php?showtopic=1506

...I [bcording]have tested the DecodeProductKey function with Windows 2000, Windows XP, Office XP Pro/Std, Project 2002, Virtual PC 2004 and Visual Studio 2003 Professional. When the Registry Enumeration function is complete these will all be added...till then.

I've been using this for some time now. [Thanks bcording!]

I changed this:

$Bin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","DigitalProductID")

InputBox("Product Key", "Your " & @OSVERSION & " product key is:", DecodeProductKey($bin), "", -1, 100, -1, -1)

To this for Office2003:

$Bin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Registration\{90110409-6000-11D3-8CFE-0150048383C9}","DigitalProductID")

InputBox("Product Key", "Your Office2003 product key is:", DecodeProductKey($bin), "", -1, 100, -1, -1)

To this for OfficeXP:

$Bin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Registration\{90280409-6000-11D3-8CFE-0050048383C9}","DigitalProductID")

InputBox("Product Key", "Your OfficeXP product key is:", DecodeProductKey($bin), "", -1, 100, -1, -1)

To date, that is all that I've needed... and I've only used this on W2k and Xp OS.

Caveat:

I do not know if I did the changes correctly, but it has worked on every system that I have used it on.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Many thanks to all.

This seems to be perfect..

Francis

B)

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