asdf103100
asked on
Reading and Righting to registry
Hey i have been trying to find everywhere a good tutorial that would actualy work for me but unfortunately i have not been able to what i want to do is open up a key in the registry using visual basics api. What i want to open up is the key located under HKEY_CURRENT_USER\Valve\Ha lf-Life\In stallPath and then get the install path from there. What im lookin for in the answer is an exmple piece of code that will get that also its a reg_sv variable just incase you need to know for the answer. What i want is an example with the appropriat comments that will get that and teach me how to input that data OR a website that will tell me how (must work for vb 6.0).
Public Function GetRegValue( strRegPath As String ) As String
Dim objWSH As Object
Set objWSH = CreateObject("WScript.Shel
GetRegValue = objWSH.RegRead( strRegPath )
Set objWSH = Nothing
End Function
To use...
MyValue = GetRegValue("HKEY_CURRENT_
Debug.Print MyValue
Regards
bukko
To write...
Public Function SetRegValue( strRegPath As String, strValue As String ) As String
Dim objWSH As Object
Set objWSH = CreateObject("WScript.Shel
objWSH.RegWrite strRegPath, strValue
Set objWSH = Nothing
End Function
To use...
SetRegValue "HKEY_CURRENT_USER\Valve\H
Regards
bukko
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
what does the script do? also its comming back with the problem that the key is not found
ASKER
what does the script do? also its comming back with the problem that the key is not found
ASKER
this is a perfect example, thank you.
ASKER
what does the script do? also its comming back with the problem that the key is not found
Use WScript.Shell
...I'll put some code together and post.
bukko