summaryrefslogtreecommitdiff
path: root/source4/scripting/bin/winreg
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/bin/winreg')
-rwxr-xr-xsource4/scripting/bin/winreg13
1 files changed, 10 insertions, 3 deletions
diff --git a/source4/scripting/bin/winreg b/source4/scripting/bin/winreg
index ac6f9e61ba..2114394f45 100755
--- a/source4/scripting/bin/winreg
+++ b/source4/scripting/bin/winreg
@@ -61,13 +61,15 @@ function list_values(path) {
}
function list_path(path) {
+ var count = 0;
var list = reg.enum_path(path);
if (list == undefined) {
println("Unable to list " + path);
- return;
+ return 0;
}
var i;
list_values(path);
+ count = count + list.length;
for (i=0;i<list.length;i++) {
var npath;
if (path) {
@@ -76,8 +78,9 @@ function list_path(path) {
npath = list[i];
}
println(npath);
- list_path(npath);
+ count = count + list_path(npath);
}
+ return count;
}
var root;
@@ -95,6 +98,10 @@ if (options.createkey) {
}
} else {
printf("Listing registry tree '%s'\n", root);
- list_path(root);
+ var count = list_path(root);
+ if (count == 0) {
+ println("No entries found");
+ return 1;
+ }
}
return 0;