purg99 Posted September 8, 2005 Share Posted September 8, 2005 (edited) I have a two part question1.Ive been playing around how to change windows CD key after an unattended install. Im able to display PID's and change the key but unable to find a way to display what key is already on a system.Display PIDstrComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery( _ "SELECT * FROM Win32_WindowsProductActivation",,48) For Each objItem in colItems Wscript.Echo "ProductID: " & objItem.ProductIDNextChange keyfor each Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_WindowsProductActivation") result = Obj.SetProductKey (VOL_PROD_KEY) if err <> 0 then Err.Clear end ifNextI DONT WANT TO USE DOWNLOADABLE TOOLS LIKE MAGICALJELLYBEANI want to know a way to display the active CDKey on a system with vbs or other tools preloaded on a standard xp build.------------------2. The long shotI also want to know a formular to generate one of the many keys from a pidhow does a pid xxxxx-640-1234567-yyyyy convert to the key xxxx-xxxx-xxxx-xxxx-xxxx Edited September 8, 2005 by purg99 Link to comment Share on other sites More sharing options...
mark Posted September 9, 2005 Share Posted September 9, 2005 I don't think you are going to get an answere for this one dude. Link to comment Share on other sites More sharing options...
bledd Posted September 9, 2005 Share Posted September 9, 2005 I don't think you are going to get an answere for this one dude.<{POST_SNAPBACK}>yeah, this'll get closed soon tbh Link to comment Share on other sites More sharing options...
IcemanND Posted September 9, 2005 Share Posted September 9, 2005 Why would this be a problem it's no different than "How do i get my Cd key, i forgot it" type questions.If your not in a rush I have a vb script which can decode it but I won't be able to post it until monday. If you want to try it yourself the cd key is in HKLM\software\microsoft\windows nt\currentversion\digitalproductidit is reverse base24 encoded in bytes 52 through 66, which when decoded will give you 25 characters of the cd key. Possible key characters are B,C,D,F,G,H,J,K,M,P,Q,R,T,V,W,Z,Y,2,3,4,6,7,8,9.Good Luck.Check back monday.Also check out KeyDecoder its and exe I wrote for the MSFN community, it's still in testing but should be finished soon.And as you can see the ProductID itself does not initself translate to th cd key, the digital encoding of it and other stuff does. Link to comment Share on other sites More sharing options...
mark Posted September 9, 2005 Share Posted September 9, 2005 (edited) It's his third post. One was about changing icons, cool. The other was about cd-keys also. Mixed keysNow he wants a script capable of pulling cd-keys of machines.DL Edited September 9, 2005 by DL Link to comment Share on other sites More sharing options...
Elektrik Posted September 9, 2005 Share Posted September 9, 2005 1. GetXPKey.vbscode:--------------------------------------------------------------------------------Set WshShell = WScript.CreateObject("WScript.Shell")strDigitalProductId="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"strXPKey=GetKey(WshShell.RegRead(strDigitalProductId))MsgBox "WinXP:"&strXPKey&chr(13)Function GetKey(rpk)Const rpkOffset=52:i=28szPossibleChars="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 IfLoop While i>=0 'Goto Rep1GetKey=szProductKeyEnd Function------------------------ Link to comment Share on other sites More sharing options...
HyperHacker Posted September 9, 2005 Share Posted September 9, 2005 Neat. But you use a Quote tag which wrecks the line spacing and thus ruins the code. Link to comment Share on other sites More sharing options...
purg99 Posted September 9, 2005 Author Share Posted September 9, 2005 (edited) It's his third post. One was about changing icons, cool. The other was about cd-keys also. Mixed keysNow he wants a script capable of pulling cd-keys of machines.DL<{POST_SNAPBACK}>DL I sure hope your NOT well known on this forum as all I can see is spam. WTF has this got to do with anything. If I dont want to post about what I had for dinner but ask real questions please dont post your kind of junk but PM me. Thank you your comments are not welcome or helpful TO ANYONE.it is reverse base24 encoded in bytes 52 through 66, which when decoded will give you 25 characters of the cd key.Thank you for the information, very handy.strXPKey=GetKey(WshShell.RegRead(strDigitalProductId))MsgBox "WinXP:"&strXPKey&chr(13)Excellent, couldnt have asked for more thank you maybe DL will even find this helpful and learn something Edited September 9, 2005 by purg99 Link to comment Share on other sites More sharing options...
Hatefulsorrow Posted September 9, 2005 Share Posted September 9, 2005 (edited) DL I sure hope your NOT well known on this forum as all I can see is spam. WTF has this got to do with anything. If I dont want to post about what I had for dinner but ask real questions please dont post your kind of junk but PM me. Thank you your comments are not welcome or helpful TO ANYONE.Dude this is a forum. Not a legal lession. People have to right to be themselves and be off tone if the mood stikes them. Leave that type of thing to the mods. Also downright chewing someone out is wrong. Please don't take your misplaced aggression out on the members. We are people too. Edited September 9, 2005 by Hatefulsorrow Link to comment Share on other sites More sharing options...
purg99 Posted September 9, 2005 Author Share Posted September 9, 2005 DL I sure hope your NOT well known on this forum as all I can see is spam. WTF has this got to do with anything. If I dont want to post about what I had for dinner but ask real questions please dont post your kind of junk but PM me. Thank you your comments are not welcome or helpful TO ANYONE.Dude this is a forum. Not a legal lession. People have to right to be themselves and be off tone if the mood stikes them. Leave that type of thing to the mods. Also downright chewing someone out is wrong. Please don't take your misplaced aggression out on the members. We are people too.<{POST_SNAPBACK}>Yep nothing legal stated. From this I too have the right to be themselves and be off tone if the mood stikes them.Thank you and have a good day as ive taken all I need Link to comment Share on other sites More sharing options...
Hatefulsorrow Posted September 9, 2005 Share Posted September 9, 2005 Very true. You do have that same right. I'm just saying that its not cool to just chew someone out because you feel like it. But hey do what you want. I'm not your keeper. Link to comment Share on other sites More sharing options...
jaclaz Posted September 9, 2005 Share Posted September 9, 2005 Some VBS code is here:http://www.experts-exchange.com/Operating_...Q_20832633.htmljaclaz 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