|
-
Feb 28th, 2007, 06:49 PM
#1
Thread Starter
Lively Member
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
-
Feb 28th, 2007, 11:05 PM
#2
Hyperactive Member
Re: Read and writing new line to multiline registry string
Dim WshShell As Object
Dim sSection As String
Set WshShell = CreateObject("WScript.Shell")
sSection = "HKEY_LOCAL_MACHINE\Software\YourAppName\"
'Check wheather your string exist
if WshShell.RegRead(sSection & "DBName")="" then
'Write to register
WshShell.RegWrite sSection & "\" & "DBName, "YourString"
endif
Set WshShell = Nothing
If the post is heplful, Please Rate it
Chathura Wijekoon
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
|