Re: Why GetStringValue return NULL?
- From: "Michael Harris \(MVP\)" <mikhar at mvps dot org>
- Date: Sat, 18 Mar 2006 21:23:30 -0800
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").
On my W2K (and XP as well), TrustPolicy is a REG_DWORD value, not REG_SZ.
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.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
Wscript.Echo "Current WSH Trust Policy Value: " & dwValue
--
Michael Harris
Microsoft MVP Scripting
.
- References:
- Why GetStringValue return NULL?
- From: Apricot
- Why GetStringValue return NULL?
- Prev by Date: Re: Schedule a script that will kick start IE
- Next by Date: Re: Ending a program with a batch file
- Previous by thread: Re: Why GetStringValue return NULL?
- Next by thread: !! DOWNLOAD THE MOST POPULAR 2006's CRACKED SOFTWARE(CAD/CAE/CAM/EDA/PCB/GIS/CNC/FEA)
- Index(es):