Why GetStringValue return NULL?
- From: Apricot <yilu@xxxxxxxx>
- Date: Sat, 18 Mar 2006 00:00:36 +0800
Dear All:
Here is code snippet digest from "The Portable Script Center",
which is a help document published on microsoft's websiet.
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "Console"
strValueName = "HistoryBufferSize"
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Wscript.Echo "Current History Buffer Size: " & dwValue
strKeyPath = "SOFTWARE\Microsoft\Windows Script Host\Settings"
strValueName = "TrustPolicy"
oReg.GetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
Wscript.Echo "Current WSH Trust Policy Value: " & strValue
I don't know how it works on your machins, but on both my two windows
2000 machines, it can't output string value ("TrustPolicy").
I tried other keys, but failed too. When I tried a key(still a string
value) under HKEY_CURRENT_USER, it works.
Why? Is it a previlidge issue?
Thanks in advance.
.
- Prev by Date: Re: hot to round time to next day, next week or next month?
- Next by Date: Returning the hyperlink text via onclick event
- Previous by thread: Error Updating Access DB
- Next by thread: Returning the hyperlink text via onclick event
- Index(es):
Relevant Pages
|
|