Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RegRead issue

Status
Not open for further replies.

Brumbie

Programmer
Apr 25, 2002
2
0
0
AU
I am trying to fill a dimension containing the value of the following registry key in NT4 using the following WScript:

Dim strInstalled, WshShell
Set WshShell = CreateObject("Wscript.Shell")

strInstalled=WSHShell.Regread("HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management\PagingFiles")

msgbox strinstalled


I am getting the following message:

Error: Type Mismatch
Code: 800A000D


I understand that it is an REG_SZ value but have not read anywhere that it should be a problem. In fact, MSDN says that RegRead supports this. I have created string values and can return the correct information.

Can anyone help with this.

[thumbsup2]

Thank you for your time.
 
This value is of REG_MULTI_SZ type(use REGEDIT to identify this).
Reading this registry type returns an array of strings. To read each item enumerate the array:
Dim strInstalled, WshShell, strPage
Set WshShell = CreateObject("Wscript.Shell")

strInstalled = WshShell.RegRead("HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management\PagingFiles")
For Each strPage In strInstalled
Wscript.Echo strPage
Next

Regards,

Stein Borge
Author of: Managing Enterprise Systems with the Windows Script Host
Over 800 pages of practical solutions oriented material, providing
detailed coverage of WSH 5.6, WMI,
ADSI, ADO, CDO, FSO and much more.
sb@nyetspam.enterprisewsh.com <- remove nyetspam when E-mailing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top