Windows Registry tool

The code:

require ‘win32ole’;class P;def initialize;
@p="";end;def p p;@p=p;end;def sk k,v;@s.RegWrite “#{@p}\#{k}”, v;end;
def gk(k);@s.RegRead “#{@p}\#{k}”;end;def i(file);regedit /s #{file};


point at a script or input from stdin

do something like this:

p ‘HKEY_LOCAL_MACHINE\Software\gaim’
sk ‘apple’, ‘banana’


i ‘something.reg’
p ‘A\path\that\should\have\changed’
gk ‘this_key_should_be_different’

Full list of commands:

p - sets the ‘path’
i - imports a registry file
sk - sets a key to the specified value
gk - gets the value of the given key

This program will print out the value of the evaluated code. (i.e.
the last line executed)

Sorry for the golfing and the ugly interface. I was just playing
around and came up with this, and though maybe someone might find it

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs