Jump to content











Photo
- - - - -

RegRead Bug?


  • Please log in to reply
4 replies to this topic

#1 larioteo

larioteo

    Member

  • Members
  • 79 posts
  •  
    European Union

Posted 07 November 2011 - 08:00 PM

Hello,

WinBuilder FileVersion: 82.0.1.0

Im a running following command in the codebox cause it failed in my script:

[process]
RegRead,HKLM,"Software\Microsoft\Windows NT\CurrentVersion",CSDVersion,%Result%
Message,%Result%,Information

This is the resulting log:
[RegRead,HKLM,"Software\Microsoft\Windows NT\CurrentVersion",CSDVersion,%Result%]
RegRead - Failed to read specified key from: [HKLM]Section: [Software\Microsoft\Windows NT\CurrentVersion] Key: [CSDVersion] to variable:: [%Result%]
Halt
Finished processing script: CodeBox test


I am realy sure that the key exists, req query works as example:

%Path%>reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CSDVersion

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
CSDVersion REG_SZ Service Pack 1

My System is Windows 7 x64 SP1

On another testmachine Windows XP SP3 x86 it works.



Only one notice for the end, in this Registry Key i can get all Values, instead of CSDVersion, i guess it is for sure a WinBuilder Bug on Windows 7.
As it dont works in CodeBox i think it is also not my fault in the script or either a syntax or type error.


Regards

#2 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 08 November 2011 - 03:49 AM

On win7 x64 a 32 bit program unless registry redirection is switched off will read the wow6432node where that value does not exist. Call System,regredirect,64 first. Don't forget to switch off after the read:

[process]
System,RegRedirect,64
RegRead,HKLM,"SoftwareMicrosoftWindows NTCurrentVersion",CSDVersion,%Result%
System,RegRedirect,Off
Message,%Result%,Information

#3 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 08 November 2011 - 03:52 AM

See http://code.google.c...stemRegRedirect for details.

#4 larioteo

larioteo

    Member

  • Members
  • 79 posts
  •  
    European Union

Posted 08 November 2011 - 11:39 AM

Thanks man it works, i didn't realized that it already sometimes dont work on 64bit, cause i have only one machine running on it, but who cares.

I would like to understand this? Whole RegKey works instead this one Value, why?

#5 paraglider

paraglider

    Gold Member

  • .script developer
  • 1729 posts
  • Location:NC,USA
  •  
    United States

Posted 08 November 2011 - 01:10 PM

To understand the consequences of using 64 bit windows with 32bit emulation MS provides useful information:

http://msdn.microsof...v=VS.85%29.aspx

Also see:
http://msdn.microsof...v=VS.85%29.aspx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users