Well, if the script is not being hosted in a .VBS or .WSF file, you'll need to change the following line of code:
Set WshShell = WScript.CreateObject("WScript.Shell"
to
Set WshShell = CreateObject("WScript.Shell"
and remove the following line:
WScript.Echo WshShell.RegRead("HKCU\Software\ACME\FortuneTeller\MindReader"
I believe you'll also need to add the RUNAT=SERVER attribute to your script tag.
FWIW, for this type of tracking, you may want to explore using a database, such as Access, ISO the registry. Jon Hawkins
thanks for your help, the following code can create the key & value now. However, if I removed the line <<WScript.Echo WshShell.RegRead("HKCU\Software\ACME\FortuneTeller\MindReader">>
how can I get the value [MindReader] and write it to the htm page??
The portion of code you must remove is the WScript.Echo because the script is not being hosted in Windows Scripting Host. The remaining portion of the code can be used to retrieve the value and then write it to your page, use a Msgbox, or whatever you choose. Jon Hawkins
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.