Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: Retrieve Windows Product Key

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,42793
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> RE: Retrieve Windows Product Key
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 RE: Retrieve Windows Product Key - 12/13/2007 1:37:32 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Try commenting out the On Error Resume Next that is on line 93 and see if you get errors.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to dedwards2)
 
 
Post #: 21
 
 RE: Retrieve Windows Product Key - 12/13/2007 2:46:29 AM   
  dedwards2

 

Posts: 5
Score: 0
Joined: 12/12/2007
Status: offline
Negative, commenting out the 'on error resume next' on line 93 generates no errors.

Double-clicking the script opens an IE window that says 'Please Wait....' and just sits there. I still see wscript.exe running.

I feel like I'm doing something fundamentally stupid - maybe I'm missing a place in the script where I need to fill in my domain name or something.

Let's say I had 200 computers in AD, and 50 of those were unreachable. How long should this script take to complete? Maybe I just need to leave it running all day. :D

(in reply to ebgreen)
 
 
Post #: 22
 
 RE: Retrieve Windows Product Key - 12/13/2007 3:31:57 AM   
  dedwards2

 

Posts: 5
Score: 0
Joined: 12/12/2007
Status: offline
OK!

About ~45 minutes after double-clicking the VBS file, I get the following WSH error:

Script: C:\Documents and Settings\username\Desktop\get_product_ID.vbs
Line: 99
Char: 1
Error: The remote server machine does not exist or is unavailable: 'GetObject'
Code: 800A01CE
Source Microsoft VBScript runtime error


Here's line 99:

      

(in reply to dedwards2)
 
 
Post #: 23
 
 RE: Retrieve Windows Product Key - 12/13/2007 3:45:55 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Ok, so it sounds like it is running but you are just getting impatient.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to dedwards2)
 
 
Post #: 24
 
 RE: Retrieve Windows Product Key - 12/13/2007 3:54:27 AM   
  dedwards2

 

Posts: 5
Score: 0
Joined: 12/12/2007
Status: offline
Hurry up and wait, roger that! :D

Thanks for all the feedback; I will uncomment the On Error line and just let it run all day.

Am I correct in reading that error message as "I can't ping this machine"? And the point of the On Error Next Resume in this loop is to keep the script running when it gets the "can't ping this machine" error?

(in reply to ebgreen)
 
 
Post #: 25
 
 RE: Retrieve Windows Product Key - 1/7/2008 6:27:52 AM   
  NewLeafIT

 

Posts: 6
Score: 0
Joined: 1/7/2008
Status: offline
I am a noob to VBS and the related languages (my experience is more in Shell/Bash/PHP/Perl) so please bear with my ignorance...

I have been trying some of the scripts in this post, and they appear to work well for many of my machines.  I'm using the HTA version now but the older machines running Office 2000 are not working.  It's failing to retrieve the information for MS Office, and returns only the OS info.  I modified the script to include 2000, but I must have done something wrong. 

I edited Line 23 and added a new element to the array (lines 36 & 37).  Here's my code.  Could someone please tell me what I am missing?

Thanks...


      


(in reply to est)
 
 
Post #: 26
 
 RE: Retrieve Windows Product Key - 1/7/2008 6:33:07 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
I don't have a machine with Office 2000 on it to check, but are you sure that the registration information Office 2k is at that registry path?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to NewLeafIT)
 
 
Post #: 27
 
 RE: Retrieve Windows Product Key - 1/7/2008 6:56:17 AM   
  NewLeafIT

 

Posts: 6
Score: 0
Joined: 1/7/2008
Status: offline
I'm waiting on a regedit screenshot off an XP machine running office 2000.  In the mean time, I can tell you that the "DigitalProductID" is directly under "Registration", and not under a GUID subfolder.  I'm thinking that is the culprit...

(in reply to ebgreen)
 
 
Post #: 28
 
 RE: Retrieve Windows Product Key - 1/7/2008 7:00:07 AM   
  NewLeafIT

 

Posts: 6
Score: 0
Joined: 1/7/2008
Status: offline
In fact, we have some users that have even older versions of office installed, and they don't have the GUID folder either.

(in reply to NewLeafIT)
 
 
Post #: 29
 
 RE: Retrieve Windows Product Key - 1/7/2008 7:03:33 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Sounds like you have some modifications ahead of you.  

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to NewLeafIT)
 
 
Post #: 30
 
 RE: Retrieve Windows Product Key - 1/7/2008 7:18:10 AM   
  NewLeafIT

 

Posts: 6
Score: 0
Joined: 1/7/2008
Status: offline
The script looks to me like it always assumes that there is a GUID folder.  But I could be misreading it... Either way, I'm not experienced enough with VBS to even determine that for sure, much less re-write the code.  There is a lot of syntax mixed in that is unfamiliar to me. The GUID logic is in the "ELSE" portion of an IF statement, so for all I know, the initial IF is determining if there is no GUID folder.  If that is the case, then the logic is already there and is just not working.  Otherwise, I'm totally off the mark.

Anyway, I'm hoping someone on here can offer some more specific suggestions of code changes to try.

(in reply to ebgreen)
 
 
Post #: 31
 
 RE: Retrieve Windows Product Key - 1/7/2008 7:26:53 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Looks like it looks at every subkey under to product root key (i.e. every subkey under SOFTWARE\Microsoft\Office\10.0\Registration for Office XP). In each subkey it looks for a value named DigitalProductID. You will need to find out how Office 2k differs from this.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to NewLeafIT)
 
 
Post #: 32
 
 RE: Retrieve Windows Product Key - 1/7/2008 8:02:37 AM   
  NewLeafIT

 

Posts: 6
Score: 0
Joined: 1/7/2008
Status: offline
Ok.  This doesn't look good.  I'm going to double check this on a different machine.

The location is still the same, but there does not seem to be a value in the DigitalProductID key.  Here's a dump from the entire "Registration" tree:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Registration]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Registration\DigitalProductID]
@=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Registration\ProductID]
@="08706-OEM-0086151-38750"

(in reply to ebgreen)
 
 
Post #: 33
 
 RE: Retrieve Windows Product Key - 1/7/2008 8:31:07 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
So it looks like maybe the info is in ProductID for 2k?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to NewLeafIT)
 
 
Post #: 34
 
 RE: Retrieve Windows Product Key - 1/7/2008 8:56:33 AM   
  NewLeafIT

 

Posts: 6
Score: 0
Joined: 1/7/2008
Status: offline
I tried tweaking the script to look under ProductID, with no luck.

After some extensive research, reading Help files for stand-alone key finder apps and whatnot, everywhere I'm looking is saying that Office 2000 does not store the key and the key cannot be retrieved.  This is beautiful, since the majority of the machines at our office have office 2000...

So, if anyone can find anything to the contrary, please advise.  I would REALLY love to be able to automate the key retrieval for asset management.  But, if not, I guess that's life!

Thanks, all

(in reply to ebgreen)
 
 
Post #: 35
 
 RE: Retrieve Windows Product Key - 1/18/2008 2:48:15 AM   
  Parabellum


Posts: 222
Score: 0
Joined: 11/12/2006
From: UK
Status: offline
sorry, i haven't checked this for a while.
Sorry to say... the reason I didn't add support for office 2000 is because you can't retrieve the key from the registry for office 2000
It is only in versions XP or later that micrsoft started storing the key in this way.
I haven't yet found any tool... vbs or other that can retrieve a 2000 key.
If you know of one, let me know and i will try and find out how it works and see if I can modify the script to add this feature.
hope this answere your question.

P

(in reply to NewLeafIT)
 
 
Post #: 36
 
 
Page:  <<   < prev  1 [2]
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> RE: Retrieve Windows Product Key Page: <<   < prev  1 [2]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts