Jump to content
JFX

Windows and Office key

Recommended Posts

UEZ

Tested on those VMs

WinXP x86 -> worked

Win2000 Server x86 -> worked

Vista x64 -> worked

Windows Server 2003 x64 -> worked

Windows Server 2008 R2 -> worked

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
supersonic

@ JFX + UEZ

Thank you both - neat! :)

Edited by supersonic

Share this post


Link to post
Share on other sites
NexusCommader

My windows 8 product key has the "N" as the first chr of the key so the key would return "N"

string replace must work different from VB to autoit

I found the bug and fixed

If $isWin8 Then
Local Const $sKeyPart1 = StringMid($sKeyOutput, 2, $iLast)
Local Const $sInsert = "N"
If Not $iLast Then
$sKeyOutput = $sInsert & StringTrimLeft($sKeyOutput, 1)
Else
$sKeyOutput = StringReplace(StringTrimLeft($sKeyOutput, 1), $sKeyPart1, $sKeyPart1 & $sInsert, 1)
EndIf
EndIf

if N is first then $iLast = 0 then $sKeyPart1 = ""

StringReplace() using "" as search causes it to replace the whole key, end result was returning "N"

after my modification key is correct

Share this post


Link to post
Share on other sites
UEZ

@NexusCommader: thanks for the update!

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
NexusCommader

further to my previous post, I tuned the win8 logic, removing the weird string replace method.

If $isWin8 Then
    $sKeyOutput = StringMid($sKeyOutput,2,$iLast)&"N"&StringTrimLeft($sKeyOutput,$iLast+1)
EndIf

tested with windows 8 and server 2012 keys, correct

Share this post


Link to post
Share on other sites
JFX

Thanks NexusCommader!

Updated first post.

Share this post


Link to post
Share on other sites
coffeeturtle

JFX et al! Thank you for a great script! My old version of Magic Jellybean was no good. Your script is a great replacement! Love it!

Can we throw in Office 2013 into the mix?

Perhaps all Adobe products as well?

Thank you again!

Share this post


Link to post
Share on other sites
guinness

coffeeturtle,

Perhaps this could be a nice little exercise for you? Since we are coders here after all. -_0


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
coffeeturtle

@guinness - I was afraid you'd say that. :shifty:::)

Share this post


Link to post
Share on other sites
guinness

I don't disappoint!


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
JFX

@coffeeturtle

Come on, if you have Office 2013 installed you can try it very easy.

Just change the registry key from "HKLMSOFTWAREMicrosoftOffice14.0Registration" to i guess "HKLMSOFTWAREMicrosoftOffice15.0Registration"

Share this post


Link to post
Share on other sites
coffeeturtle

Thanks! I will give it a try when I get to my machine with that installation. :)

Share this post


Link to post
Share on other sites
flappert87

Case "Office 2013 x86"
$RegKey = 'HKLMSOFTWAREMicrosoftOffice15.0Registration'
IF @OSArch = 'x64' Then $RegKey = "HKLM64SOFTWAREWow6432NodeMicrosoftOffice15.0Registration"
For $i= 1 to 250
$var = RegEnumKey($RegKey, $i)
If @error <> 0 then ExitLoop
$bKey = RegRead($RegKey & '' & $var, 'DigitalProductID')
IF Not @error Then ExitLoop
Next
$iKeyOffset = 0x328



Case "Office 2013 x64"
IF @OSArch <> 'x64' Then SetError(1, 0, "Product not found")
$RegKey = 'HKLM64SOFTWAREMicrosoftOffice15.0Registration'
For $i= 1 to 250
$var = RegEnumKey($RegKey, $i)
If @error <> 0 then ExitLoop
$bKey = RegRead($RegKey & '' & $var, 'DigitalProductID')
IF Not @error Then ExitLoop
Next
$iKeyOffset = 0x328

Edited by flappert87

Share this post


Link to post
Share on other sites
JFX

Thanks flappert87! Added both to first post.

Share this post


Link to post
Share on other sites
Emiel Wieldraaijer

I tested the script on Office 2013 but it gives a wrong result

You can check the last five digits with  cscript.exe OSPP.VBS  /dstatus the script is available in the office installation folder

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites
loloplat

Hi. Is it possible to adapt this script to get Windows keys from non-local machines on a business network. Thanks in advance.

Edited by loloplat
Added translation

Share this post


Link to post
Share on other sites
Melba23

loloplat,

This is an English speaking forum - please post in English in future. Google Translate is pretty useful. ;)

Ici nous sommes anglophone - veuillez poster en anglais dorenavant. Google Translate est tres utile. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
JayHawkfl

Works like a dream, Showed it to the other programmer at the office, and we're thinking about swapping out the program we use to retreive keys from our remote sites with this.


Thanks for your time

 

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

×