diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-08-24 08:32:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:34:29 -0500 |
commit | 4a37c7ebbe0beec064f11ea075e1a5285290d7e1 (patch) | |
tree | 5cd9f3788f18e81be146dad45ed769ad9e00c84f /source4/scripting/bin | |
parent | 649882d8d59f35cf51166bedd73c2eab4cea7e50 (diff) | |
download | samba-4a37c7ebbe0beec064f11ea075e1a5285290d7e1.tar.gz samba-4a37c7ebbe0beec064f11ea075e1a5285290d7e1.tar.bz2 samba-4a37c7ebbe0beec064f11ea075e1a5285290d7e1.zip |
r9568: updated the winreg js library for CreateKey, and add a --createkey
option to the winreg tool
(This used to be commit 881452c7b7cc00222328f743c2c0c4ece39f4c96)
Diffstat (limited to 'source4/scripting/bin')
-rwxr-xr-x | source4/scripting/bin/winreg | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source4/scripting/bin/winreg b/source4/scripting/bin/winreg index 7845f1034c..12f40f1155 100755 --- a/source4/scripting/bin/winreg +++ b/source4/scripting/bin/winreg @@ -12,7 +12,8 @@ libinclude("winreg.js"); var options = GetOptions(ARGV, "POPT_AUTOHELP", "POPT_COMMON_SAMBA", - "POPT_COMMON_CREDENTIALS"); + "POPT_COMMON_CREDENTIALS", + "createkey=s"); if (options == undefined) { println("Failed to parse options"); return -1; @@ -61,6 +62,10 @@ function list_values(path) { function list_path(path) { var list = reg.enum_path(path); + if (list == undefined) { + println("Unable to list " + path); + return; + } var i; list_values(path); for (i=0;i<list.length;i++) { @@ -83,6 +88,13 @@ if (options.ARGV.length > 1) { root = ''; } -printf("Listing registry tree '%s'\n", root); -list_path(root); +if (options.createkey) { + var ok = reg.create_key("HKLM\\SOFTWARE", options.createkey); + if (!ok) { + + } +} else { + printf("Listing registry tree '%s'\n", root); + list_path(root); +} return 0; |