Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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
[marto]: Wolfsbane , now I'm having flashbacks
[choroba]: Isn't Using PerlPod Creatively rather a meditation?
[choroba]: I don't see a question
[1nickt]: ugh, I stuck my head in the bass bin for 30 seconds on a dare at Ted Nugent at Hammersmith Odeon. Yes, I am 40% deaf now.
[johngg]: My daughter is incredibly jealous of my wife who got to see The Clash at Brixton many years ago. They went to see The Vaccines there recently.
[1nickt]: But the bands are even louder! I saw Spearhead (Michael Franti) at an outdoor show and had to walk a mile away to not feel pain in my chest! Babies were crying ... I asked the sound engineer why it was necessary to have the bass so loud and he laughed...
[Discipulus]: but the best i attended live was Mano Negra Patchanka at Forte Prenestino .. in 1990

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-03-24 12:13 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (301 votes). Check out past polls.