Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Read Multi-string Registry Value


hi people.

im stuck on reading a multi-string registry value. If you have any shared folder on your computer you can see the problem im getting here:
HKEY_LOCAL_MACHINESYSTEMControlSet001ServiceslanmanserverShares

Im trying to read the key "wireless" and the value is:
CSCFlags=0
MaxUses=4294967295
Path=C:Documents and SettingsmeDesktopNew Folder
Permissions=0
Remark=
Type=0

but via reading it normally i only get "CSCFlags=0" but how can i get all that data not just the first line?

thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Registry Multi-string Only In XP?
I understand that the multi-string data type is only available in XP?

So what happens if I create an application that writes a multi-string and someone runs it on pre XP? Will it error out or will it just stuff it into a regular string data type?

Any info would be appreciated.

Registry (Save And Read) And Get The # Of Lines In A String!
Since I don't know how to properly use API, can someone please write me a code that has 2 functions (1 for writing strings into the registry and the other for reading from the registry!). Thanks for your help.

Read And Writing New Line To Multiline Registry String
I've been a bit confused with some of the registry examples I've seen so far...

Theres a registry string that may or may not exist. If it doesn't I want to add it. I need to check this string and if it does exist I need to write a new line without overwriting the previous data.

How can I achieve this?

Sorry if the question is vague.

Thanks

Read Multi Level Xml File In Vb6 Help Plz Plz!
Hi everyone,

I want to read a multi level XML file in VB6:-

-<SR-DATA>
    -<tbl_Service>
        -<SR-21>
            -<data here>

        </SR_21>
    </tbl_Service>
</SR-DATA>

Cheers very much

Jiggy

Read Values From Multi-dimensional Array
I am reading registry values, which are returned in a multi-dimensional array.
I can debug.print to see the values just fine, but what I would like to do is add these values to a comma delimited string.

Any ideas how I can do this?

Here's the code

VB Code:
If Len(mstrSystem) <> 0 Then   strRegSettings = GetAllSettings(mstrSystem, "Options")                   For i = LBound(strRegSettings, 1) To UBound(strRegSettings, 1)      Debug.Print strSettings(i, 0), strSettings(i, 1)   Next iEnd If

How To Add, Read And Redim A Multi Dimensional Array
Hi,
I have a multi dimensional array with 4 columns.
I am reading a XML file. I need to keep adding into the array whenever a new value is encoutered.
Column1 is code.
Column2 is title
Column3 is Description
Column4 would be the number times the same code has come across in the xml file.
Right now what I am doing is Dim array()
redim array(4,0)
read the xml file
for j=0 to objCodes.length-1
set objChild= objCodes.item(j).childnodes
Code = objChild(0).getattribute("code")
Title =objChild(1).getattribute("title")
Desc=objChild(2).getattribute ("Desc")
for i=0 to UBound(array)
if array(i,0)=Code then
array(i,3)=array(i,3)+ 1
else
redim Preserve array(UBound(array)+1)
array(i,0)=Code
array(i,1)=title
array(i,2)=Desc
array(i,3)="1"
end if
next i
next j

But am not able to redim my multi dimensional array. It is always 0 only.
Any help would be appreciated.

How Do I Read From The Registry?
How do I read from the Registry?

I want to ready this key:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice11.0ExcelInstallRoot
Name: Path
Type: REG_SZ
Data: C:Program FilesMicrosoft OfficeOFFICE11

Some on please help!

Thank you for your time and help.

Read From Registry?
I have been trying to figure out how to save and read from the registry. I have done alot of looking around at all the post and have put together the code below. It saves in the registry just fine but I can not seam to be able to read it back into my program for some reason. What do I have wrong?


Code:
Private Sub Command1_Click()
UName = UNtxt.Text
Password = Ptxt.Text
SaveSetting "Program143", "Pass", Password, UName
End Sub

Private Sub Command2_Click()
UNtxt = GetSetting("Program143", "Pass", "UName")
Ptxt = GetSetting("Program143", "Pass", "Password")
End Sub

Read From Registry
can somebody check the code and tell me that how shall i obtain the database name in case of this from the odbc.ini registry...currently in this my database name is fun and it gives me its driver, now how can i obtain the dbname by using this.....


waqas

Read From Registry
Hi guys. Once time again i need help. I need to read some key from registry and write it into textbox.

I know how to read from registry. But i dont know how to write that value to textbox.

HKEY_LOCAL_MACHINESOFTWARETalkAndTalkTalkAndTalk

and it needs to read value "password" w/o quotes

I need that for "Forgot Password" in my application :P


again thanks!

Read From Registry
I am using this code to write to the registry:


Code:
Private Sub RegWriteInterval()
On Error Resume Next
Dim Reg As Object
Set Reg = CreateObject("Wscript.shell")
Reg.RegWrite RegKeyAddress, Value
End Sub


Is there similar code I can use to read from the registry? Thanks

Registry Read With API Only?
How do I get a key's data using API's only? Thanks. (No WScript please)

How To Read From Registry
Hello,

I hava project, when i start it first time, it save the starting date in registry.

TASK I WANT :

1. How to add 15 days in Starting Date
2. Check the date (if it reach the 15th day or not) if reach the show Expiray Message.

Simply i want to make My project Expire through Registry.

Please help me.
Farooq

Cant Read The Registry
I am using a module by KayJay that I found in the codebank. Which I've attached

Although I seriously doubt the fault is in there.

I'm trying to access a certain key in the registry. and save to it works using this:

VB Code:
Call SaveSettingString(HKEY_CURRENT_USER, "SoftwareMicrosoftWindowsCurrentVersionInternet Settings", "User Agent", cmbUA.Text)


But I have trouble when reading the key using this:

VB Code:
MsgBox GetSettingString(HKEY_CURRENT_USER, "SoftwareMicrosoftWindowsCurrentVersionInternet Settings", "User Agent")

it just return a blank string

Why is this happening? Why don't I get what has been saved?

Read Registry
I want to read all keys from some folders in the registry. The problem is that the folder names are random. I don't know their number...

the path is: HKLMsoftwareICSU<random string>. ex:
HKLMsoftwareICSUfsdfs56-fsdfs5d666-555555
HKLMsoftwareICSUfsd543-321323566-gdfgdfg
in this folder there is a string called SN. I need to get the value of SN. I know how to read the value... I just don't know how to go to HKLMsoftwareICSU and read all the folders below it(fsdfs56-fsdfs5d666-555555 and fsd543-321323566-gdfgdfg).

I have a similar solution to read files under a folder in the file system... The idea is the same, but the code is not!

strFileName = Dir$("c:myFilesFolder")
While strFileName <> ""
FileName = "c:myFilesFolder" & strFileName
strFileName = Dir$()
Wend

Read Registry Key
I need help reading a registry. I need to compare the value of the "Display Name" string found in: HKMLsoftwaremicrosoftwindowsCurrentVersionUninstallWord
with myStr.

please help..

I have:
Dim hregkey As Long ' receives handle to the newly created or opened registry key
Dim secattr As SECURITY_ATTRIBUTES ' security settings of the key
Dim neworused As Long ' receives 1 if new key was created or 2 if an existing key was opened
Dim stringbuffer As String ' the string to put into the registry
Dim retval As Long ' return value
subkeyWord7 = "softwaremicrosoftwindowsCurrentVersionUninstallWord"
secattr.nLength = Len(secattr) ' size of the structure
secattr.lpSecurityDescriptor = 0 ' default security level
secattr.bInheritHandle = True ' the default value for this setting

'MSWord 7
retval = RegCreateKeyEx(HKEY_LOCAL_MACHINE, subkeyWord7, 0, "", 0, KEY_READ, secattr, hregkey, neworused)
If retval <> 0 Then ' error during open
Debug.Print "Error opening or creating registry key -- aborting."
End
End If
stringbuffer = subkeyWord7 & vbNullChar ' note how a null character must be appended to the string
retval = RegQueryValueEx(hregkey, subkeyWord7, 0, REG_SZ, ByVal stringbuffer, Len(stringbuffer)) ' write the string
MsgBox stringbuffer

retval = RegCloseKey(hregkey)




thanks

Read Registry
Hi all,

VB has a function GetAllSettings(appname, section), which return a variant contains all registry key in a section under HKEY_CURRENT_USERSoftwareVB and VBA...

I want to WRITE a similar function, say:

Code:
GetAllSettingX(hKey As Long, strPath As String) as Variant


To use this function:

Code:
myvariant = GetAllSettingX(HKEY_LOCAL_MACHINE,"Software")


I think you may come across this already. If not you may need it some day. This will hide this user from knowing that your application is written in VB.

CAN YOU HELP?

Regards,
TheBao

Read In Registry With VB6
I want to read the registry of Windows 98 and store the information of "HKEY_CURRENT_USERControl PanelInternationalsDecimal".
How can I do that?

My best regards
José Nogueira

Can't Read Registry?!
I have a VB application that stores registration information in the registry under HKEY_CURRENT_USER, and everything works just fine *most* all the time. However, once in a while a user will find that the registration information isn't available. The information *is* still in the registry, but the API call to read it fails. The behavior is inconsistent: most users don't ever encounter a problem, but the ones that do hit it only find it happening to them maybe 1 in 20 times, so far on both Windows 2000 and Windows XP.

I'm using RegOpenKeyExA to open the appropriate key, and RegQueryValueExA to get the information.

Here's some of the code:

lDataTypeValue=REG_SZ
Value$=Space$(2048)
StrSize=len(Value$)

lRetVal=RegOpenKeyExA(HKEY_CURRENT_USER,"SoftwareMcKernonRegInfo",0&,KEY_QUERY_VALUE,GroupHandle&)
IF lRetVal=ERROR_NONE THEN
    lRetVal=RegQueryValueExA(GroupHandle,"SerNum",0&,lDataTypeValue,Value$,strSize)
END IF

Because I can't duplicate the problem on any of my systems here, I'm not sure exactly where it's failing -- on the OpenKey, on the RegQueryValue, or because the strSize is coming back = 0.

Has anybody else run into anything like this? I'm frankly baffled, especially by the erratic nature of the problem.

TIA -

- John

How To Read For Registry
Hi All,

I'm trying to read from registry but i don't know really how.....

There is a method :
GetSetting

I need to read for example

Path:

HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders

Value name: AppData



I need to find the value data.

Hope you can help .

Thanks,

Re-read Registry
I've got a VB application that changes some hardware settings and currently I've got to do a restart for windows to re read the registry and pick up the changes..

Is their a way to get windows to re-read the registry without a restart from within a VB app

Any help most appreciated

Read From Registry
Hi,

I need to export from registry to text file a whole section programmatically. Can anyone help ?

Valery Iskarov Nikolov
Software Dynamics

How To Read A REG_MULTI_SZ Value From The Registry
Hi there and thanks in advance,
I'm trying to read a REG_MULTI_SZ value from the registry with the API:

Public Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long

The problem is that I don't know what type of data do I have to use in Visual Basic to declare the lpData variable ( variable where the info is retrieved) . I tryed with string and variant with no success.

Read Values From Registry
Hello,

I have this application which adds and removes values in the Registry under the path (I don't think it matters but here it is, HKEY_LOCAL_MACHINESOFTWARETEST). When the application starts I want to load the already made values in the Registry under this path and not make them again from the beginning. And I would like this to work dynamically of course. I guess this is a simple one but I can not seem to figure it out as it is my first experience with Registry manipulating.

Thanxs in advance,
Nikolas

Read A File Using Registry
Hi folkz,

I designed a code where I could read a file, when given the path - C:Program Files s.log and search for a particular string in it and display the output.
Now, I need to know if there is any way where instead of giving he above mentioned path, I cud make the program read the file using registry location -
HKEY_LOCAL_MACHINESoftwareTimberlineGeneralSystem DirectoryMiscTS.LOG

Also, I'd like to know wht changes I need to do if incase I need to hard code a "NAME" inside HKEY_LOCAL_MACHINESoftwareTimberlineGeneralScreenTS.SCR
Would it be possible for me to do this ???

Thanks in advance.

Nirmala.

Registry - Read And Write Value
I've only ever seen the scripting method of reading a writing registry keys. This is a problem because Norton sees registry editing through scripting as 'malicious'.

Would anyone show me the simplest way possible to read and write a single registry value with API? Thanks.

How Can I Read From A Server Registry
Hi, i have an application that savesetting in a server registry when i configure it. I installed the application y other machine, and i need to read from that registry to validate some security items.

Can i do that?

Read/write Into Registry
in a visual basic n00b and i was woundering how u write settings into the registry and then read them at a later date.
thanks in adv

Read The Keys In The Registry?
I'm using the standard method for read/write in the registry (SaveSetting,GetSetting). And I need to read the name of each key. This key are usernames for my app.

Can I Read Other Registry Area By VBA?
Dear All:

Did anybody know how to read the registry except "VB and VBA Program Settings". I want read ODBC user DSN information.

My point is what kind of database customer using in the runtime. So I can write 2 DIFFERENT statements to link Access or SQL Server by DAO.

Can't Read Registry Values
I have a simply registration for my program where the registratoin key enetered is stored in the registry. I have 1 user who can not retrive(read) the registation key as it brings back a blank value even though the registration key has been saved. (have checked with user via regedit).

Below is the code I'm using. Can anyone see what the problem is?


Code:
Private Sub Command1_Click()
CreateKey "HKCUSoftwareTestTest Entry", "Test Entry"
MsgBox "The value 'Test Entry' was saved"
End Sub

Private Sub Command2_Click()
Dim KeyValue As String
KeyValue = ReadKey("HKCUSoftwareTestTest Entry")

If KeyValue = "" Then
MsgBox "No value was read"
Else
MsgBox "The value '" & KeyValue & "' was read"
End If
End Sub

Public Sub CreateKey(Folder As String, Value As String)
Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
b.RegWrite Folder, Value
Set b = Nothing
End Sub

Public Function ReadKey(Value As String) As String
Dim r As String
Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
r = b.RegRead(Value)
ReadKey = r
Set b = Nothing
End Function

WMI Read Remote Registry
I am not able to read a value from another PCs remote registry. With the below code I get the error: SWBemObjectEx: Type Mismatch. This registry key exists and has a value. I can find it in the registry by searching both the name and value. This key corresponds to the computer description (Right click My Computer, Properties, Click Computer Name tab, and there you will find Computer Discription.
Thanks


Dim strComputer, StdOut, strValue

const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "mhhc-mis-13"

Set StdOut = WScript.StdOut

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\" &_
strComputer & "
ootdefault:StdRegProv")

strValue = oReg.GetBinaryValue("HKLMSYSTEMControlSet001Serviceslanmanserverp arameterssrvcomment")

stdOut.WriteLine strValue

Registry Read/Write
Having trouble understanding how to read, create, and write/change Registry keys in VB6. Is there a simple function I can use? VB .NET offers several, but haven't found any for VB6. Need access to HKLMSoftware in particular.

- kcary

[ Resolved]Read From Registry
Hello i need code how to read from registry.


so for example i got HKEY_LOCAL_MACHINEsoftwaremyappimportant
ame


So i need to read the value of "name" and write it on label


ty

Read/write Registry
Hello. After some search here in vbforum, I decided to use the file "Microsoft Visual StudioVB98TemplateCodeRegistry Access.bas" to read and write values from/to registry.

But I just can't find any simple example for it.
So, I want t read a value from "HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerPageSetupheader"

I've done this:

Code:
Private Sub Command1_Click()
Dim chaveRoot As String, ChaveNome As String
Dim chave As String
Dim x As Variant


chave = "HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerPageSetupheader"

chaveRoot = "HKEY_CURRENT_USER"
ChaveNome = "SoftwareMicrosoftInternet ExplorerPageSetupheader"

x = AcessoReg.GetKeyValue(HKEY_CURRENT_USER, ChaveNome, "")

MsgBox x
End Sub



I'm not getting any value from this key.
What am I missing?

Thank you

Read Registry Subkeys
Hey, Is it possible in vb6 to loop through the registry and create an array of data in which all the subkeys from a certain area are listed in the array and then one can loop through the array to get the data?

Thanks for any pointers.

How To Read Registry Tree ?
Hellow,

I have such function:

Private Function Registry_Read(Key_Path, Key_Name) As Variant
On Error Resume Next
Dim Registry As Object
Set Registry = CreateObject("WScript.Shell")
Registry_Read = Registry.RegRead(Key_Path & Key_Name)
End Function


How to read all the keys in Registry:
HKEY_LOCAL_MACHINESOFTWAREMICROSOFTWINDOWSCURRENTVERSIONRUN

I want to get all programs which RUNS at startup.

Read Registry Key [SOLVED]
I just want to know how can i read the value of a key

the folder that i'm looking for is :

HKEY_Current_usersoftwarewindowscurrentVersionexplorershellFolders and i want the value of the attribute program

how can i do this ??

thanks

Read Registry Keys
I want to search a section of the registry, and change keys after the key is read, how do I do that?

For example: I want to read all of the keys that are to open on Windows reboot, and add them to a listbox.

I can read 1 key just fine, but how do I change keys?

Thanks,
Sir Loin

I Can't Read This One Registry Key...but All Others...*Resolved*
I have some code for a little program that uses AOL Instant Messenger as a host and so I want to run it on startup. My program uses the registry in various places all over, and can read/write/etc to every directory except I can't seem to read the installed AIM directory, found here:

HKEY_CURRENT_USERSoftwareAmerica OnlineAOL Instant Messenger (TM)CurrentVersionAppPath

It is listed under the key "(Default)"

Any ideas on how to read this key?

Please test code before posting it here, as I've tried 2 examples from other people's posts and can't seem to get to work. Hell, maybe I'm just stupid though

Thanks for your help!

Can't Read Registry Values
I have a simply registration for my program where the registratoin key enetered is stored in the registry. I have 1 user who can not retrive(read) the registation key as it brings back a blank value even though the registration key has been saved. (have checked with user via regedit).

Below is the code I'm using. Can anyone see what the problem is?


VB Code:
Private Sub Command1_Click()CreateKey "HKCUSoftwareTestTest Entry", "Test Entry"MsgBox "The value 'Test Entry' was saved"End Sub Private Sub Command2_Click()Dim KeyValue As StringKeyValue = ReadKey("HKCUSoftwareTestTest Entry") If KeyValue = "" ThenMsgBox "No value was read"ElseMsgBox "The value '" & KeyValue & "' was read"End IfEnd Sub Public Sub CreateKey(Folder As String, Value As String)Dim b As ObjectOn Error Resume NextSet b = CreateObject("wscript.shell")b.RegWrite Folder, ValueSet b = NothingEnd Sub Public Function ReadKey(Value As String) As StringDim r As StringDim b As ObjectOn Error Resume NextSet b = CreateObject("wscript.shell")r = b.RegRead(Value)ReadKey = rSet b = NothingEnd Function

Read Registry Keys.
Is it possible to read Registry keys? And if so could someone show me the code. And how is it possible to insert keys into the registry????

Read Registry[solved]
My current project have got the user setting which makes the program autorun on windows startup, i've got the code for writing and deleting, but i dont have the code to check if it's already added.

This is my code for writing and deleting:

VB Code:
Public Function AddToStartup()         REG_SaveString pvpHK.HKEY_CURRENT_USER, pvpRunHKey, "Commander", App.Path & "" & App.EXEName & ".exe"End Function Public Function RemoveFromStartup()         REG_DeleteValue pvpHK.HKEY_CURRENT_USER, pvpRunHKey, "Commander"End Function Private Sub REG_SaveString(ByVal Hkey As Long, strPath As String, strValue As String, strData As String)    Dim keyhand As Long    Dim r As Long    r = RegCreateKey(Hkey, strPath, keyhand)    r = RegSetValueEx(keyhand, strValue, 0, REG_SZ, ByVal strData, Len(strData))    If r = 87 Then        REG_DeleteValue Hkey, strPath, strValue    End If    r = RegCloseKey(keyhand)End Sub Private Function REG_DeleteValue(ByVal Hkey As Long, ByVal strPath As String, ByVal strValue As String)    Dim keyhand As Long    Dim r As Long    r = RegOpenKey(Hkey, strPath, keyhand)    r = RegDeleteValue(keyhand, strValue)    r = RegCloseKey(keyhand)End Function


Does anone have code for checking if the item already exists in the Run-folder in the registry?

Thanks in advance

Read Registry Folders
I know how to use SaveSettings and GetSettigns to pull keys from the registry, but I would like to be able to loop through all of the sub folders in a folder and get their name.

Are there any VB functions that will allow me to do this, or will I have to use API functions to achive what I want. Thanks...

Read/Update Registry
I want to check this registry key:
HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsProxyEnable

It should be a 1 or a 0 - how do I update it if the setting needs to be changed to a 1 or 0?(depending on its current setting)?

Thanks

SaveIng To Teh REgiStry- READ
I want to save a line of code to REgistry Once a Button is Pressed,

I want my Program to be added to the "RUN" Section of the registry, so eveytime their comp restarts my program runs.

YOu Know What I MeaN?

Read Registry Errors
I'm trying to make a small application that lists the recent
VB6 files, then lets you select and delete the one you dont
want to appear.

The trouble is, I don't know how many values are in the key
so I am just looping up to a reasonably high number (20).

Obviously an error is going to occur when the value doesnt
exist. What I can't work out is why my code doesn't trap the
error.


VB Code:
Dim WshShell As ObjectSet WshShell = CreateObject("wscript.Shell")Dim i As Integeri = 1Err = 0 Do While Err = 0'    For i = 1 To 20       On Error Resume Next'    MsgBox Err        Debug.Print WshShell.regread("HKEY_CURRENT_USERSoftwareMicrosoftVisual Basic6.0RecentFiles" & i)i = i + 1'    Next i LoopSet WshShell = Nothing


/Andrew

Read And Write To Registry
hi evey body
i want to making reading and writing to registry without using the getsetting and setsetting
i don't want to save in the temporary folder in the registry i want to save in speccific folder like my name and under this folder will be all my parameters
thanx agian

Read Reg_Binary From Registry
HI

Someone knows how to read "Reg_Binary" Key From Registry on win XP Machine with (VB 6.0)


Thanks!


JP IV

Copyright © 2005-08 www.BigResource.com, All rights reserved