phiban Posted October 2, 2006 Share Posted October 2, 2006 Does anyone know a command which i can use to view a machines product key?A little background info:Im developing a application for my companies Network, which will retrieve a machines Product Key, also i need to know if its possible to change it?is there a registry location for the product keys? and if so can i simply change it and then have the user re-activate?Ta Link to comment Share on other sites More sharing options...
prx984 Posted October 2, 2006 Share Posted October 2, 2006 well, windows 95/98/me had it in the registry, but for those of us on 2000/xp its elsewhere. heres a utility to view the key on 2000/XP (it works on other os's too)http://www.magicaljellybean.com/keyfinder.shtmlunfortuneatly, i wouldn't know the first place to start when making a program, but i hope that program is of help Link to comment Share on other sites More sharing options...
phiban Posted October 2, 2006 Author Share Posted October 2, 2006 cheers for the linky! Anyone else know where it is? Link to comment Share on other sites More sharing options...
Littlebr00k Posted October 2, 2006 Share Posted October 2, 2006 The product key is still in the registry but it i encoded different ways in different places.If you are programming in delphi Go HereIf you are programming in C# Go HereHope this helps Link to comment Share on other sites More sharing options...
phiban Posted October 2, 2006 Author Share Posted October 2, 2006 cheers great info! Link to comment Share on other sites More sharing options...
Hamins Posted October 2, 2006 Share Posted October 2, 2006 Try this registry key ..HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion Link to comment Share on other sites More sharing options...
phiban Posted October 2, 2006 Author Share Posted October 2, 2006 (edited) Cheers Hamins, so how do i actually read it?The product id is just numbers? Edited October 2, 2006 by phiban Link to comment Share on other sites More sharing options...
The Apache Posted October 2, 2006 Share Posted October 2, 2006 ok, ignore the programming info.do this:go to start, click on run, type in: regeditnow, click on the following:1) HKEY_LOCAL_MACHINE2) SOFTWARE 3) Microsoft4) Windows NT5) CurrentVersionhere's a screenshot: Link to comment Share on other sites More sharing options...
prx984 Posted October 2, 2006 Share Posted October 2, 2006 thats product ID not product KEYproduct key is usually "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"25 characters Link to comment Share on other sites More sharing options...
Plamdi Posted October 3, 2006 Share Posted October 3, 2006 (edited) '==========================================================================' NAME: GetCDKeyandSerialNumber.vbs'' AUTHOR: Mark D. MacLachlan , The Spider's Parlor' URL: http://www.thespidersparlor.com' DATE : 3/16/2006' (C) 2006, All Rights Reserved'' COMMENT:''==========================================================================Set WshShell = CreateObject("wscript.Shell")Set WshNetwork = WScript.CreateObject("WScript.Network")Set env = WshShell.environment("Process")strComputer = env.Item("Computername")Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")Const HKEY_LOCAL_MACHINE = &H80000002Const UnInstPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_".\root\default:StdRegProv")strDigitalProductId="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"strXPKey=GetKey(WshShell.RegRead(strDigitalProductId))Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)For Each objItem in colItems report = report & "Original CD Key:"& strXPKey & vbCrLf report = report & "SerialNumber: " & objItem.SerialNumber & vbCrLfNextMsgBox reportFunction GetKey(rpk) Const rpkOffset=52:i=28 szPossibleChars="BCDFGHJKMPQRTVWXY2346789" Do 'Rep1 dwAccumulator=0 : j=14 Do dwAccumulator=dwAccumulator*256 dwAccumulator=rpk(j+rpkOffset)+dwAccumulator rpk(j+rpkOffset)=(dwAccumulator\24) and 255 dwAccumulator=dwAccumulator Mod 24 j=j-1 Loop While j>=0 i=i-1 : szProductKey=mid(szPossibleChars,dwAccumulator+1,1)&szProductKey if (((29-i) Mod 6)=0) and (i<>-1) then i=i-1 : szProductKey="-"&szProductKey End If Loop While i>=0 'Goto Rep1GetKey=szProductKeyEnd Function'' WMI Script - ChangeVLKey.vbs'' This script changes the product key on the computer''***************************************************************************ON ERROR RESUME NEXTif Wscript.arguments.count<1 then Wscript.echo "Script can't run without VolumeProductKey argument" Wscript.echo "Correct usage: Cscript ChangeVLKey.vbs ABCDE-FGHIJ-KLMNO-PRSTU-WYQZX" Wscript.quitend ifDim VOL_PROD_KEYVOL_PROD_KEY = Wscript.arguments.Item(0)VOL_PROD_KEY = Replace(VOL_PROD_KEY,"-","") 'remove hyphens if anyfor each Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_WindowsProductActivation") result = Obj.SetProductKey (VOL_PROD_KEY) if err <> 0 then WScript.Echo Err.Description, "0x" & Hex(Err.Number) Err.Clear end ifNextI think this is by the same author, apologies script has been modded, I've restored it to the best of my ability to be the original version. Edited October 3, 2006 by Plamdi Link to comment Share on other sites More sharing options...
phiban Posted October 3, 2006 Author Share Posted October 3, 2006 Thanks for the help Plamdi! thanks everyone! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now