|
-
Nov 15th, 2006, 12:26 AM
#1
Thread Starter
New Member
simple question for a vb6 guy
I have some code that I am having issues with.. The code blows up if the registry value doesnt exist. This is what I am trying to check for but I get an run time error because it doesnt exist.
I just want to return a value of "not" if the registry value does not exist. Can someone help me out?
Thanks! Below is the code I have (as a function). This should be pretty simple but vb6 syntax is a challenge for me.
Function checkinstalled()
Dim WSH, result, theval
Set WshShell = CreateObject("WScript.Shell")
theval = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\InstallRoot")
If theval <> "" Then
result = "installed"
Else
result = "not"
End If
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|