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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using registry value as a variable in my subroutine??

Status
Not open for further replies.

ntauzin

MIS
May 24, 2002
11
US
Hi-

I need to locate a registry value (it is a path, c:\folder, for example) and then use it in a sub. How do I do that?

The sub is a command button that will be deleting files in that directory. But since the directory location is not always the same I want to use the location that is specified in the registry.

Any suggestions?

 
If it is a registry setting that is set by your application then you can use

SaveSetting

and

GetSetting

There is documentation in the help on these.

If you need to read another value then you'll have to use the API to read it
 
It's not set by my application, it is an existing key value.
 
Another related question - how do I delete a registry value?
 
I would suggest that you look into the following Win32 API calls which provide a good deal of functionality against the Registry.

RegCreateKeyEx
RegOpenKeyEx
RegSaveKey
RegDeleteKey

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top