Hello

I was wondering if it's possible to use VBscript as a means to get a value from the registry and if not, how it can be done using VB6

Thanks a lot

-Dany

RE: Reading a registry Value by anonymous

anonymous
Wed Jan 21 07:51:07 CST 2004

Dany

Have a look at this link.. It will give you all the details to reading from the registry using VBscript

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsMthRegRead.asp

Kev..

Re: Reading a registry Value by Alex

Alex
Wed Jan 21 09:19:57 CST 2004

One thing I should mention - technically, VBScript has no means whatsoever
of reading from the registry; it is always dependent on something external
designed to do this, such as WshShell or WMI. What Kev pointed you to can
therefore be used as easily from either VBScript or VB6.

Dany K wrote:
> Hello,
>
> I was wondering if it's possible to use VBscript as a means to get a
> value from the registry and if not, how it can be done using VB6.
>
> Thanks a lot,
>
> -Dany



Re: Reading a registry Value by john

john
Wed Jan 21 14:58:38 CST 2004

Sure is.

Use WMI and the system registry provider.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/system_registry_provider.asp


Code to read a string value into sString may look something like:-
(Watch for word wrap)

'***********************************************

Const HKEY_CURRENT_USER = &H80000001
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005

Dim oRegistry, sKey, sValue, sString

'** Where to look
sKey = "Software\Microsoft\DataAccess"
sValue = "Version"

'** Get local registry from WMI and read string value.
Set oRegistry = GetObject("winmgmts:root\default:StdRegProv")
RetVal = oRegistry.GetStringValue(HKEY_LOCAL_MACHINE, sKey, sValue,
sString)

msgBox "Value of sString = " & sString

set oRegistry = Nothing

'*******************************************************

But, don't quote me on that....

Cheers

John


Dany K <anonymous@discussions.microsoft.com> wrote in message news:<1CAC8282-BBB8-4068-9A40-590D5B4BA558@microsoft.com>...
> Hello,
>
> I was wondering if it's possible to use VBscript as a means to get a value from the registry and if not, how it can be done using VB6.
>
> Thanks a lot,
>
> -Dany