summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-24 17:52:58 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-26 05:15:11 +0200
commit57f6663f3a029945fe7e799d4371131d9a20d306 (patch)
tree378633beba1c7b79a845a50ea596566648ad2258 /source4/scripting
parent976eca077d2ea9b44b4b62ae851ca9cc470e3729 (diff)
downloadsamba-57f6663f3a029945fe7e799d4371131d9a20d306.tar.gz
samba-57f6663f3a029945fe7e799d4371131d9a20d306.tar.bz2
samba-57f6663f3a029945fe7e799d4371131d9a20d306.zip
Remove obsolete ejs winreg example.
(This used to be commit f1a2d2bc00dac56080b2bd560074ec66d12a3129)
Diffstat (limited to 'source4/scripting')
-rwxr-xr-xsource4/scripting/bin/winreg107
1 files changed, 0 insertions, 107 deletions
diff --git a/source4/scripting/bin/winreg b/source4/scripting/bin/winreg
deleted file mode 100755
index 883c6d7ee3..0000000000
--- a/source4/scripting/bin/winreg
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/bin/sh
-exec smbscript "$0" ${1+"$@"}
-/*
- tool to manipulate a remote registry
- Copyright Andrew Tridgell 2005
- Released under the GNU GPL version 3 or later
-*/
-
-var options = GetOptions(ARGV,
- "POPT_AUTOHELP",
- "POPT_COMMON_SAMBA",
- "POPT_COMMON_CREDENTIALS",
- "createkey=s");
-if (options == undefined) {
- println("Failed to parse options");
- return -1;
-}
-
-libinclude("base.js");
-libinclude("winreg.js");
-
-if (options.ARGV.length < 1) {
- println("Usage: winreg.js <BINDING> [path]");
- return -1;
-}
-var binding = options.ARGV[0];
-reg = winregObj();
-
-print("Connecting to " + binding + "\n");
-status = reg.connect(binding);
-if (status.is_ok != true) {
- print("Failed to connect to " + binding + " - " + status.errstr + "\n");
- return -1;
-}
-
-function list_values(path) {
- var list = reg.enum_values(path);
- var i;
- if (list == undefined) {
- return;
- }
- for (i=0;i<list.length;i++) {
- var v = list[i];
- printf("\ttype=%-30s size=%4d '%s'\n", reg.typestring(v.type), v.size, v.name);
- if (v.type == reg.REG_SZ || v.type == reg.REG_EXPAND_SZ) {
- printf("\t\t'%s'\n", v.value);
- }
- if (v.type == reg.REG_MULTI_SZ) {
- var j;
- for (j in v.value) {
- printf("\t\t'%s'\n", v.value[j]);
- }
- }
- if (v.type == reg.REG_DWORD || v.type == reg.REG_DWORD_BIG_ENDIAN) {
- printf("\t\t0x%08x (%d)\n", v.value, v.value);
- }
- if (v.type == reg.REG_QWORD) {
- printf("\t\t0x%llx (%lld)\n", v.value, v.value);
- }
- }
-}
-
-function list_path(path) {
- var count = 0;
- var list = reg.enum_path(path);
- if (list == undefined) {
- println("Unable to list " + path);
- return 0;
- }
- var i;
- list_values(path);
- count = count + list.length;
- for (i=0;i<list.length;i++) {
- var npath;
- if (path) {
- npath = path + "\\" + list[i];
- } else {
- npath = list[i];
- }
- println(npath);
- count = count + list_path(npath);
- }
- return count;
-}
-
-var root;
-
-if (options.ARGV.length > 1) {
- root = options.ARGV[1];
-} else {
- root = '';
-}
-
-if (options.createkey) {
- var ok = reg.create_key("HKLM\\SOFTWARE", options.createkey);
- if (!ok) {
- println("Failed to create key");
- }
-} else {
- printf("Listing registry tree '%s'\n", root);
- var count = list_path(root);
- if (count == 0) {
- println("No entries found");
- return 1;
- }
-}
-return 0;