dkikis Posted August 21, 2012 Posted August 21, 2012 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
Moderators JLogan3o13 Posted August 21, 2012 Moderators Posted August 21, 2012 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!
Andreik Posted August 21, 2012 Posted August 21, 2012 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)
dkikis Posted August 22, 2012 Author Posted August 22, 2012 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:
AdmiralAlkex Posted August 22, 2012 Posted August 22, 2012 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. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now