Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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?


Replies are listed 'Best First'.
Re: windows 7 HardwareID
by sundialsvc4 (Abbot) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://939006]
Approved by ww
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2018-03-22 16:37 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (279 votes). Check out past polls.