Top-rated recipes tagged "registry"http://code.activestate.com/recipes/tags/registry/top/2013-10-15T07:30:39-07:00ActiveState Code RecipesGet a value un windows registry (Python)
2013-10-15T07:30:39-07:00Garel Alexhttp://code.activestate.com/recipes/users/2757636/http://code.activestate.com/recipes/578689-get-a-value-un-windows-registry/
<p style="color: grey">
Python
recipe 578689
by <a href="/recipes/users/2757636/">Garel Alex</a>
(<a href="/recipes/tags/registry/">registry</a>, <a href="/recipes/tags/win32api/">win32api</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>A small function to get a value in windows registry from its key path and value name.</p>
<p>Note that recipe <a href="http://code.activestate.com/recipes/502268/" rel="nofollow">http://code.activestate.com/recipes/502268/</a> gives a more complete solution.</p>
Win Registry module (Python)
2010-07-20T14:30:04-07:00Louis RIVIEREhttp://code.activestate.com/recipes/users/4035877/http://code.activestate.com/recipes/502268-win-registry-module/
<p style="color: grey">
Python
recipe 502268
by <a href="/recipes/users/4035877/">Louis RIVIERE</a>
(<a href="/recipes/tags/registry/">registry</a>, <a href="/recipes/tags/system/">system</a>, <a href="/recipes/tags/windows/">windows</a>).
Revision 5.
</p>
<p>_winreg module wrapper.
Provides easy access, walking and creation/modification of keys and values.
Tested with Win98 and XP (admin)</p>
Retrieve codecs (Ruby)
2012-11-19T08:49:26-08:00greg zakharovhttp://code.activestate.com/recipes/users/4184115/http://code.activestate.com/recipes/578340-retrieve-codecs/
<p style="color: grey">
Ruby
recipe 578340
by <a href="/recipes/users/4184115/">greg zakharov</a>
(<a href="/recipes/tags/codecs/">codecs</a>, <a href="/recipes/tags/ironruby/">ironruby</a>, <a href="/recipes/tags/registry/">registry</a>).
</p>
<p>On WinXP (there is no other Windows in my VMWare Player :) you can do it with Ruby in the next way:</p>
<p>require 'win32/registry'</p>
<p>Win32::Registry::HKEY_CLASSES_ROOT.open(
'CLSID{083863F1-70DE-11d0-BD40-00A0C911CE86}\Instance'
) do |reg|
reg.each_key do |key|
val = reg.open(key)
puts val['FriendlyName']
end
end</p>
<p>But what about extended information, aah? I'm talking about script which shows additional data such as CLSID and codec location. With IronRuby it can be done so easy.</p>
Reading all subvalues of key (Ruby)
2012-11-19T08:41:11-08:00greg zakharovhttp://code.activestate.com/recipes/users/4184115/http://code.activestate.com/recipes/578337-reading-all-subvalues-of-key/
<p style="color: grey">
Ruby
recipe 578337
by <a href="/recipes/users/4184115/">greg zakharov</a>
(<a href="/recipes/tags/registry/">registry</a>).
</p>
<p>With Ruby you can make wonders ;) This snippet shows how to read all subvalues of a key at one time.</p>
collections.MutableMapping wrapper around _winreg (Python)
2010-09-01T12:20:06-07:00Daniel Stutzbachhttp://code.activestate.com/recipes/users/4174048/http://code.activestate.com/recipes/577381-collectionsmutablemapping-wrapper-around-_winreg/
<p style="color: grey">
Python
recipe 577381
by <a href="/recipes/users/4174048/">Daniel Stutzbach</a>
(<a href="/recipes/tags/registry/">registry</a>, <a href="/recipes/tags/winreg/">winreg</a>, <a href="/recipes/tags/_winreg/">_winreg</a>).
</p>
<p>The _winreg module is a thin wrapper around the Windows C API to the Windows Registry. As a thin wrapper, it's not very Pythonic. This recipe defines a class using the MutableMapping ABC to create a dictionary-like interface to the Windows Registry.</p>
Recursively querying for registry subkeys (Python)
2009-07-28T03:23:29-07:00Heinz Hermannhttp://code.activestate.com/recipes/users/4171265/http://code.activestate.com/recipes/576860-recursively-querying-for-registry-subkeys/
<p style="color: grey">
Python
recipe 576860
by <a href="/recipes/users/4171265/">Heinz Hermann</a>
(<a href="/recipes/tags/regdeletetree/">regdeletetree</a>, <a href="/recipes/tags/registry/">registry</a>, <a href="/recipes/tags/substitute/">substitute</a>, <a href="/recipes/tags/win32api/">win32api</a>).
Revision 2.
</p>
<p>Because the Windows XP API does not support the RegDeleteTree function, the programmer has to query for subkeys of a registry key recursively, before he can delete it. This functions returns all subkeys of a registry key in deleteable order, which means the deepest subkey is the first in the list. </p>