Windows Registry tool.

G

Gregory Brown

The code:

require 'win32ole';class P;def initialize;@s=3DWIN32OLE.new "WScript.Shell"=
;
@p=3D"";end;def p p;@p=3Dp;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}`;
end;end;puts P.new.instance_eval(ARGF.read)

Usage:

point at a script or input from stdin

do something like this:

p 'HKEY_LOCAL_MACHINE\Software\gaim'
sk 'apple', 'banana'

or

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
useful?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top