Get Registry Data?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • WallyWonka
    Forum Member
    • Dec 2007
    • 28

    Get Registry Data?

    There is a Registry.DoesKeyExist, but is there a Registry.DoesDataExist option?
    For instance, I want my auto play app to read a specific entry in the registry

    MainKey=HKEY_LOCAL_MACHINE
    SubKey=SOFTWARE\Microsoft\Windows\CurrentVersion\U ninstall\MyApp
    Value=DisplayVersion
    Data=1.00.000

    What code would I use to get a particular Data from the registry?
  • RizlaUK
    Indigo Rose Customer
    • May 2006
    • 5552

    #2
    try this:
    Code:
    sKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MyApp"
    bKey = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, sKey);
    if bKey then
    	-- key dose exist
    	sData = Registry.GetValue(HKEY_LOCAL_MACHINE, sKey, "DisplayVersion", true);
    
    else
    	-- key dose not exist
    	
    end
    Embrace change in your life, you never know, it could all work out for the best

    Comment

    • ShadowUK
      No longer a forum member
      • Oct 2007
      • 1322

      #3
      Darn it Rizla! Escape your strings!

      Code:
      sKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MyApp"
      bKey = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, sKey);
      if bKey then
      	-- key dose exist
      	sData = Registry.GetValue(HKEY_LOCAL_MACHINE, sKey, "DisplayVersion", true);
      
      else
      	-- key dose not exist
      	
      end
      \ >> \\

      Comment

      • RizlaUK
        Indigo Rose Customer
        • May 2006
        • 5552

        #4
        lol, what a amature mistake :lol i should be ashamed
        Embrace change in your life, you never know, it could all work out for the best

        Comment

        Working...
        X