Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

windows 7 HardwareID

by TomKane (Beadle)
on Nov 19, 2011 at 21:54 UTC ( #939006=perlquestion: print w/ replies, xml ) Need Help??
TomKane has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to find a unique windows value that I can use for basing a product key on. I have been fetching the machine ID on XP and Vista from the registry and that works fine. However, I've just been working with Windows 7 und alles kaput.

The following works fine with XP and Vista:

my $Machine = Win32::TieRegistry->new( "LMachine/Software/Microsoft/MSLicensing/HardwareID", { Access=>"KEY_READ", Delimiter => '/', }, ) ;

But on Windows 7, $Machine is undefined. I've tried every conceivable permutation that I can imagine ... and then some. Even running that snippet as an administrator. I can get and set values under HKEY_CURRENT_USER in Win7 fine. I just can't pull in values from HKEY_LOCAL_MACHINE.

It sorta looks like I need to brush up on the Win7 administration of rights and privileges. Any suggestions on what I need to be looking into would be welcome.

Maybe my goal is wrong. Does anyone know of any other unique identifier for Windows machines?

Thanks.

Comment on windows 7 HardwareID
Download Code
Re: windows 7 HardwareID
by sundialsvc4 (Monsignor) on Nov 20, 2011 at 13:54 UTC

    It does sound like you have stumbled-upon a Win7 difference, and I’m sure that Microsoft must talk about it somewhere on MSDN.   When you find out, please report back.

      Thanks for your reply. Yes, I'm looking in MSDN and will continue to plug away until I can worry it out. Everything so far indicates that I should be able to use Access => "KEY_READ" in Tie::Registry as read-only doesn't endanger the Windows 7 security. I'll share whatever I come up with.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://939006]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2014-07-11 09:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (224 votes), past polls