Sign in to follow this  
Followers 0
dkikis

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

5 posts in this topic

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

Share this post


Link to post
Share on other sites



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"))

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Why don't use native AutoIt function RegRead? For me works pretty well on xp x64:

$ProductId = RegRead("HKLM64SOFTWAREMicrosoftWindows NTCurrentVersion","ProductID")

MsgBox(0,"ProductId",$ProductId)

When the words fail... music speaks

Share this post


Link to post
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:

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0