Sign in to follow this  
Followers 0
Xenobiologist

Windows XP SerialNumber, ProductKey, etc

20 posts in this topic

#1 ·  Posted (edited)

Hi,

maybe some people could use it and do not look into the Idea Lap area.

So, here it is : Link to thread

So long,

Mega

P.S.. Hope that is NO double posting :o

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites



Ehi, your script is great!

Share this post


Link to post
Share on other sites

Ehi, your script is great!

Thanks, if you´ve got some ideas for improving or you miss some information, let me know. :o

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Uber cool


-jaenster

Share this post


Link to post
Share on other sites

Thanks, if you´ve got some ideas for improving or you miss some information, let me know. :o

So long,

Mega

Here is an idea for you. It would be good if your script could find the Microsoft Office product key as well.


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

Here is an idea for you. It would be good if your script could find the Microsoft Office product key as well.

Thats a good idea.

Like jellybean keyfinder :o


Sapiente vince, rex, noli vincere ferro!

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Hi,

thanks for your replies. That should be possilbe. :geek:

I´ll work on that maybe at wednesday.

Now I´m gonna celebrate carnival. :o

Helau Alaaf! ;):sorcerer::huggles::zorro::dance::cheer:

So long,

Mega

Maybe only Office 2003 should be enough?!???

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Got this error in Line 70

$colSettings = $objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")

$colSettings = $objWMIService.E^ ERROR

Error: Unable to parse line.

Share this post


Link to post
Share on other sites

Got this error in Line 70

$colSettings = $objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")

$colSettings = $objWMIService.E^ ERROR

Error: Unable to parse line.

HI,

I cannot re-enact this error. Works fine for me. I also released a new Version, now the OfficeKey is included.

Hope you´ll like it.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Got this error in Line 70

$colSettings = $objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")

$colSettings = $objWMIService.E^ ERROR

Error: Unable to parse line.

Same to me ...

Another (VBS)-Script with an equal expression works fine on my machine ...

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")

First thought was WMI not enabled, because i use a "nlited"-version of Win XP Pro,but thats not the problem.

I want to create a "GUI-attended" Windows Setup-CD/DVD with a "PostInstall"-Menue to install further

drivers/Software/Addons , adding Sys-Info to my AutoIT-created PostInstall-GUI.

But i´m a NOOB :">

Thx.

Miko

Share this post


Link to post
Share on other sites

Same to me ...

Another (VBS)-Script with an equal expression works fine on my machine ...

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")

First thought was WMI not enabled, because i use a "nlited"-version of Win XP Pro,but thats not the problem.

I want to create a "GUI-attended" Windows Setup-CD/DVD with a "PostInstall"-Menue to install further

drivers/Software/Addons , adding Sys-Info to my AutoIT-created PostInstall-GUI.

But i´m a NOOB :">

Thx.

Miko

Hi,

the problem was already answered in the other thread. You need beta. And you need to compile it with beta version!

Hi,

If you are using Scite you pressed ALT+F5 which means Beta-Run. That should work.

When you compile the au3. file you have to use compile (bata) script to exe from the beta folder of autoit-installation.

Hope that helps and you like the script.

Edit: Besides, I would always toggle to beta. :-)

So long,

Mega

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

the problem was already answered in the other thread. You need beta. And you need to compile it with beta version!

So long,

Mega

Thx, now it works.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

If you don't mind i changed the gui a little bit :">

 

; ----------------------------------------------------------------------------

;

; AutoIt Version: 3.1.1 beta

; Author: Thorsten Meger & ...

;

; Script Function:

; Windows XP Information displayed in a Gui

;

; ----------------------------------------------------------------------------

#include <GUIConstants.au3>

$GUI = GUICreate("", 380, 315, -1, -1)

GUISetFont(9, 700, -1, "MS Sans Serif")

$windowsInformation_L = GUICtrlCreateLabel(" Windows Information", 5, 3, 290, 25)

$status_L = GUICtrlCreateLabel("Information read ...", 20, 280, 200, 20)

$description_L = GUICtrlCreateLabel("Description", 20, 58, 100, 20)

$windowsType_L = GUICtrlCreateLabel("WindowsType", 20, 83, 100, 20)

$serialNumber_L = GUICtrlCreateLabel("SerialNumber", 20, 108, 100, 20)

$ProductKey_L = GUICtrlCreateLabel("ProductKey", 20, 133, 100, 20)

$InstallDate_L = GUICtrlCreateLabel("InstallDate", 20, 158, 100, 20)

$LastBootUpTime_L = GUICtrlCreateLabel("LastBootUpTime", 20, 183, 100, 20)

$RegisteredOwner_L = GUICtrlCreateLabel("RegisteredOwner", 20, 208, 100, 20)

$officeKey_L = GUICtrlCreateLabel("OfficeKey", 20, 233, 100, 20)

$description_I = GUICtrlCreateInput("", 125, 55, 235, 20)

$windowsType_I = GUICtrlCreateInput("", 125, 80, 235, 20)

$serialNumber_I = GUICtrlCreateInput("", 125, 105, 235, 20)

$ProductKey_I = GUICtrlCreateInput("", 125, 130, 235, 20)

$InstallDate_I = GUICtrlCreateInput("", 125, 155, 235, 20)

$LastBootUpTime_I = GUICtrlCreateInput("", 125, 180, 235, 20)

$RegisteredOwner_I = GUICtrlCreateInput("", 125, 205, 235, 20)

$officeKey_I = GUICtrlCreateInput("", 125, 230, 235, 20)

$informationPanel_G = GUICtrlCreateGroup("Information Panel", 10, 35, 360, 225)

$status_G = GUICtrlCreateGroup("Status", 10, 265, 360, 40)

$font = "Comic Sans MS"

GUICtrlSetColor($windowsInformation_L, 0xff0000)

GUICtrlSetFont($windowsInformation_L, 16, 700, 4, $font)

$progressbar = GUICtrlCreateProgress(140, 278, 220, 20)

Global $product = ""

Global $counter = 3

Global $wait = 150

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

If $counter = 3 Then

Sleep(1000)

GUICtrlSetData($status_L, "Initialize ... " & $counter)

progress()

$counter -= 1

ElseIf $counter = 2 Then

GUICtrlSetData($status_L, "Initialize ... " & $counter)

progress()

$counter -= 1

ElseIf $counter = 1 Then

GUICtrlSetData($status_L, "Initialize ... " & $counter)

progress()

$counter -= 1

ElseIf $counter = 0 Then

GUICtrlSetData($status_L, "Ready ...")

progress()

$counter -= 1

ElseIf $counter = -1 Then

Dim $Bin = RegRead("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion", "DigitalProductID")

Dim $key4RegisteredOwner = "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion"

$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!.rootcimv2")

$colSettings = $objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")

For $objOperatingSystem In $colSettings

Next

GUICtrlSetData($description_I, StringMid($objOperatingSystem.Description, 1))

GUICtrlSetData($windowsType_I, '(' & @OSVersion & ') ' & StringMid($objOperatingSystem.Caption, 19))

GUICtrlSetData($serialNumber_I, StringMid($objOperatingSystem.SerialNumber, 1))

GUICtrlSetData($ProductKey_I, DecodeProductKey($Bin))

GUICtrlSetData($InstallDate_I, WMIDateStringToDate($objOperatingSystem.InstallDate))

GUICtrlSetData($LastBootUpTime_I, WMIDateStringToDate($objOperatingSystem.LastBootUpTime))

GUICtrlSetData($RegisteredOwner_I, RegRead($key4RegisteredOwner, "RegisteredOwner"))

GUICtrlSetData($officeKey_I, getOfficeKey())

GUICtrlSetData($officeKey_L, "Office " & $product)

$counter -= 1

ElseIf $counter < - 1 Then

Select

Case $msg = $GUI_EVENT_CLOSE

GUICtrlSetState($progressbar, $GUI_HIDE)

GUICtrlSetData($status_L, "Goodbye My Lover")

Sleep(2000)

ExitLoop

EndSelect

EndIf

WEnd

Exit

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

Func WMIDateStringToDate($dtmDate)

Return (StringMid($dtmDate, 7, 2) & "/" & _

StringMid($dtmDate, 5, 2) & "/" & StringLeft($dtmDate, 4) _

& " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate, 13, 2))

EndFunc

Func progress()

If $counter = 3 Then

For $i = 0 To 20 Step 1

GUICtrlSetData($progressbar, $i)

Sleep($wait / 20)

Next

ElseIf $counter = 2 Then

For $i = 20 To 50 Step 1

GUICtrlSetData($progressbar, $i)

Sleep($wait / 30)

Next

ElseIf $counter = 1 Then

For $i = 50 To 80 Step 1

GUICtrlSetData($progressbar, $i)

Sleep($wait / 30)

Next

ElseIf $counter = 0 Then

For $i = 80 To 100 Step 1

GUICtrlSetData($progressbar, $i)

Sleep($wait / 20)

Next

GUICtrlSetState($progressbar, $GUI_SHOW)

EndIf

EndFunc

Func getOfficeKey()

Local $List[1]

Local $i = 1

$var = RegRead("HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice11.0CommonInstallRoot", "Path")

If $var <> "" Then

$product = "2003"

Dim $officeKey = "HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice11.0Registration"

Else

$var = RegRead("HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice10.0CommonInstallRoot", "Path")

If @error <> 0 Then

GUICtrlSetData($status_L, "Info: Unable to find installationPath, maybe no Office installed!")

Return "No Office XP or 2003 found"

EndIf

If $var <> "" Then

$product = "XP"

Dim $officeKey = "HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice10.0Registration"

EndIf

EndIf

Dim $var = RegEnumKey($officeKey, $i)

If @error <> 0 Then

GUICtrlSetData($status_L, "Info: Unable to find REG_BINARY 'DigitalProductID', maybe no Office installed!")

Return "No Office XP or 2003 found"

Else

$List[$i - 1] = RegRead($officeKey & "" & $var, "DigitalProductID")

If $List[$i - 1] = "" Then

GUICtrlSetData($status_L, "Info: Unable to find REG_BINARY 'DigitalProductID', maybe no Office installed!")

Else

$key = $List[$i - 1]

Return DecodeProductKey($key)

EndIf

EndIf

EndFunc

Edited by Melba23
Removed email address

Sapiente vince, rex, noli vincere ferro!

Share this post


Link to post
Share on other sites

If you don't mind i changed the gui a little bit :">

Hi,

no problem.

Have fun playing around with the code.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

I'm new with autoIT and I'm learning. Is it possible to write the code, that you can write a new serial key or new information of the owner to the registry?

TY

bubke

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Hi,

I'm new with autoIT and I'm learning. Is it possible to write the code, that you can write a new serial key or new information of the owner to the registry?

TY

bubke

Hi & welcome,

sure that is possible.

Have a look at :

 

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.1 beta
; Author:       
;
; Script Function:
;   RegisteredOwner for Windows XP --> change
;
; ----------------------------------------------------------------------------

#include <GUIConstants.au3>

;GUI
$GUI = GUICreate("Change RegisteredOwner", 170, 200, 200, 200)

;Label
$RegisteredOwner_L = GUICtrlCreateLabel("RegisteredOwner", 10, 10, 150, 17)
$NewRegisteredOwner_L = GUICtrlCreateLabel("Type: New RegisteredOwner", 10, 70, 150, 17)
$status_L = GUICtrlCreateLabel("Status", 10, 170, 150, 17,$SS_SUNKEN)

;Input
$RegisteredOwner_I = GUICtrlCreateInput("RegisteredOwner", 10, 30, 150, 17)
$NewRegisteredOwner_I = GUICtrlCreateInput("New RegisteredOwner", 10, 90, 150, 17)

;Button
$ok = GUICtrlCreateButton("Change RegisteredOwner", 10, 120, 150, 23)

;Variable
Dim $count = 0
Dim $key4RegisteredOwner = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
GUICtrlSetData($RegisteredOwner_I, RegRead($key4RegisteredOwner, "RegisteredOwner"))

;TrayIconToolTip
TraySetToolTip("Change RegisteredOwner")

GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    If $count < 1 Then
        Sleep(2000)
        GUICtrlSetData($status_L, "ready...")
        $count += 1
    EndIf
    Select
        Case $msg = $GUI_EVENT_CLOSE
            GUICtrlSetData($status_L, "So long, Mega")
            Sleep(1000)
            ExitLoop
        Case $msg = $ok
            $status = RegWrite($key4RegisteredOwner, "RegisteredOwner", "REG_SZ", ControlGetText("","", $NewRegisteredOwner_I))
            If $status = 1 Then
                GUICtrlSetData($status_L, "changed successfully...")
                Sleep(1000)
                GUICtrlSetData($status_L, "ready...")
            Else
                GUICtrlSetData($status_L, "Error...")
            EndIf
    EndSelect
WEnd
Exit

Hope that helps.

So long,

Mega

ChangeRegisteredOwner.au3

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

How can I simply show RegisteredOwner in a Msgbox?

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

Yep, look at the code, strip out the unnecessary parts, add in the MsgBox, and you are done!

Already tried without success :D Edited by masvil

Share this post


Link to post
Share on other sites

Hi,

try this:

MsgBox(64, "RegOwner", RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "RegisteredOwner"))

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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