Reading values from register

G

Guest

Hello,

When I try to retrieve values from the register with

Select Case
Dir(CStr(My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\Software\Kassasysteem\Gegevenslocatie",
"Gegevenspad", "")) & "\" &
CStr(My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\Software\Kassasysteem\Gegevenslocatie", "Gegevensbestand", "")))

and the entries I look for do not exist, I nevertheless get a value
"AClient.cfg", a file that is located on the root directory of my C drive.

How is this possible?
Both keys
HKEY_LOCAL_MACHINE\Software\Kassasysteem\Gegevenslocatie\Gegevenspad
and
HKEY_LOCAL_MACHINE\Software\Kassasysteem\Gegevenslocatie\Gegevensbestand
do NOT exist in the registry.

Can anyone enlighten me on that?

Many thanks and greetings from Brugge (Bruges - Belgium),

Michel
 
G

Guest

Michel,

When the values don't exist in the registry you are returning a default
value of "".

Therefore, the argument to the Dir function is "" & "\" & "". In other
words, you are looking in the root directory.

Kerry Moorman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top