Jump to content

regread("...\productid") in windows64 falis


 Share

Recommended Posts

I need to read the value of productid stored in the registry.

i_RegKey = "HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PRODUCTID"

On Error Resume Next

'access Windows scripting

Set myWS = CreateObject("WScript.Shell")

testc = myWS.RegRead(i_RegKey)

the error is "unable to open the registry key ...productid for reading

this works fine in Vista and Win2007 (32 bit) but fails on 64bit platforms.

I went through permissions (but it can not reset "some" of the of the keys...

any ideas???

thanks in advance

dk

Link to comment
Share on other sites

  • Moderators

Hi, dkikis. Your script is not in AutoIt, so you need to convert. You should be able to do something like this.

MsgBox(0, "", RegRead("HKLM64SOFTWAREMicrosoftWindows NTCurrentVersion", "ProductID"))

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

some caviats...

1.The code is in VBA .

2.I have gotten farther with the definiton i_RegKey ="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductId"

this does NOT get the ProductId with 64Bits but does get it under a 32 platform. Consistenly!

3.If I make a change such as i_RegKey ="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\BuildGUID" then the call works:

Set myWS = CreateObject("WScript.Shell")

testc = myWS.RegRead(i_RegKey) (testc gets the value)

(and it works consistenly under both 32 and and 64!)

Hence, I considered permissions: The edit permissions operates on the CurrentVersion tree and produces the following infomation message/error:

Link to comment
Share on other sites

Hi and Welcome to the forums!!

some caviats...

1.The code is in VBA .

And this is the AutoIt forums. If you work in VBA then you need to find yourself a VBA forum.

Hence, I considered permissions: The edit permissions operates on the CurrentVersion tree and produces the following infomation message/error:

An invisible error. How intriguing.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...