Registry mit VBScript auslesen

  • #1
A

--AUSI--

Guest
Hi!
Ich würde gerne einen Eintrag aus der Registry mit VBScript auslesen um dies in einer HTML-Site verwenden zu können.
Ich hab folgendes Beispiel gefunden um einen Eintrag zu schreiben, funktioniert jedoch nicht:

<html>
<body>
<script LANGUAGE=VBScript type=text/vbscript>
<!--
Dim WSHShell, RegLocate, RegLocate1
Set WSHShell = WScript.CreateObject(WScript.Shell)
'On Error Resume Next
RegLocate = HKEY_CURRENT_USER\Control Panel\Desktop\
' Take great care with the line above
' Note the space between \Internet and Settings\

WSHShell.RegWrite WallpaperStyle,0,REG_SZ
WScript.Quit
' Tells the script to stop and exit.
</script>
</body>
</html>

Der IE sagt missing Object: WScript
Kann mir da jemand weiterhelfen?
 
  • #2
Hi,

ich kann mir eigentlich nicht vorstellen, dass man bei ner Scriptsprache die im Browser ausgeführt wird auf die Registry zugreifen kann (und wenn dann wäre das Schlimm, aber beim IE weiß man ja nie ;) ).

War der Code vielleicht für VBScript, der aber direkt mit dem Windows Scripting Host ausgeführt wird und nicht im IE?

Edit: vor </script> fehlt übrigens //--> wenn du nach <script> mit <!-- anfängst :)
 
  • #3
<html>
<body>
<script LANGUAGE=VBScript type=text/vbscript>
<!--
Dim WSHShell, RegLocate, myVar
Set WSHShell = WScript.CreateObject(WScript.Shell)
'On Error Resume Next
RegLocate = HKEY_CURRENT_USER\Control Panel\Desktop\WallpaperStyle

myVar = WSHShell.RegRead (RegLocate,0,REG_SZ)

document.write Wallpaper-Style = & myVar & <br>

-->
</script>
</body>
</html>
 
Thema:

Registry mit VBScript auslesen

ANGEBOTE & SPONSOREN

Statistik des Forums

Themen
113.840
Beiträge
707.965
Mitglieder
51.494
Neuestes Mitglied
Flensburg45
Oben