summaryrefslogtreecommitdiffstats
path: root/source/scripting/bin
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-08-24 08:32:51 +0000
committerAndrew Tridgell <tridge@samba.org>2005-08-24 08:32:51 +0000
commit0956f7a86ce67420f7ca0de7984115029b88160c (patch)
tree1cf3a4fddf57e462f687b1ecc919dbf0c76d0889 /source/scripting/bin
parent108669170d29b8f5a1c54f81cbbf701f98a52002 (diff)
downloadsamba-0956f7a86ce67420f7ca0de7984115029b88160c.tar.gz
samba-0956f7a86ce67420f7ca0de7984115029b88160c.tar.xz
samba-0956f7a86ce67420f7ca0de7984115029b88160c.zip
r9568: updated the winreg js library for CreateKey, and add a --createkey
option to the winreg tool
Diffstat (limited to 'source/scripting/bin')
-rwxr-xr-xsource/scripting/bin/winreg18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/scripting/bin/winreg b/source/scripting/bin/winreg
index 7845f1034c5..12f40f11555 100755
--- a/source/scripting/bin/winreg
+++ b/source/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;