Hi,
I have following adapted code from this forum (search for "regdelete"
condition: Intranet, without security confirmation required
<script type="text/javascript">
[ignore]
<!--
// user, node, loc, script;
function write_params() {
var Shell = new ActiveXObject("WScript.Shell"
var RegistryKey = new Array ("user", "node", "script", "loc"
var status;
var element;
var key
for (var i = 0; i <= 3; i++) {
element = eval("document.params." + RegistryKey);
key = "HKLM\\censored\\"+RegistryKey
status = KeyExists(Shell, key);
if (status) {
element.value = Shell.RegRead("HKLM\\censored\\"+RegistryKey);
document.write(element.value);
} else {
alert(key + ": key with this name not existent"
}
}
//var user = Shell.RegRead("HKLM\\censored\\user"
//var node = Shell.RegRead("HKLM\\censored\\node"
//var script = Shell.RegRead("HKLM\\censored\\script"
//var loc = Shell.RegRead("HKLM\\censored\\loc"
//document.write(user + ", " + node + ", " + script + ", " + loc)
}
function KeyExists(obj, key) {
var ttkey
try {
ttkey=obj.RegRead(key);
}
catch(e) {
if (e !=0)
return false;
}
return true;
}
-->
</script>
</head>
<body>
<form name="params" action="sge_questions" Method="POST">
<input type="hidden" name="user" value="">
<input type="hidden" name="node" value="">
<input type="hidden" name="script" value="">
<input type="hidden" name="loc" value="">
<script type="text/javascript">
write_params();
</script>
....
[/ignore]
It just doesn't work.
It gets into an endless loop, if it doesnt find the key.
The variant with reading the keys directly works, but it must not give out any errors, if the script fails. (security issue)
I wopuld appreciate any help or hints
Thanks in advance,
cattys
I have following adapted code from this forum (search for "regdelete"
condition: Intranet, without security confirmation required
<script type="text/javascript">
[ignore]
<!--
// user, node, loc, script;
function write_params() {
var Shell = new ActiveXObject("WScript.Shell"
var RegistryKey = new Array ("user", "node", "script", "loc"
var status;
var element;
var key
for (var i = 0; i <= 3; i++) {
element = eval("document.params." + RegistryKey);
key = "HKLM\\censored\\"+RegistryKey
status = KeyExists(Shell, key);
if (status) {
element.value = Shell.RegRead("HKLM\\censored\\"+RegistryKey);
document.write(element.value);
} else {
alert(key + ": key with this name not existent"
}
}
//var user = Shell.RegRead("HKLM\\censored\\user"
//var node = Shell.RegRead("HKLM\\censored\\node"
//var script = Shell.RegRead("HKLM\\censored\\script"
//var loc = Shell.RegRead("HKLM\\censored\\loc"
//document.write(user + ", " + node + ", " + script + ", " + loc)
}
function KeyExists(obj, key) {
var ttkey
try {
ttkey=obj.RegRead(key);
}
catch(e) {
if (e !=0)
return false;
}
return true;
}
-->
</script>
</head>
<body>
<form name="params" action="sge_questions" Method="POST">
<input type="hidden" name="user" value="">
<input type="hidden" name="node" value="">
<input type="hidden" name="script" value="">
<input type="hidden" name="loc" value="">
<script type="text/javascript">
write_params();
</script>
....
[/ignore]
It just doesn't work.
It gets into an endless loop, if it doesnt find the key.
The variant with reading the keys directly works, but it must not give out any errors, if the script fails. (security issue)
I wopuld appreciate any help or hints
Thanks in advance,
cattys