Solved

Reading and Writting to a REG_MULTI_SZ Value

Posted on 2004-08-01
1
892 Views
Last Modified: 2012-08-14
I'm trying to find a way of reading and writting to a REG_MULTI_SZ Value in a simple way through CreateObject("WScript.Shell").

Thanks in advance,
Kalaka
0
Comment
Question by:kalaka
1 Comment
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 130 total points
Comment Utility
At the below, you'll see "Note   The REG_MULTI_SZ type is not supported for the RegWrite method" so it's not possible through the scripting object.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsMthRegWrite.asp


Here's an example of reading REG_MULTI_SZ values. The returned data is an array.

Private Sub Form_Load()
    Dim objWShell As Object, strTest As Variant, intLoop As Integer
    Set objWShell = CreateObject("WScript.Shell")
    strTest = objWShell.RegRead("HKEY_LOCAL_MACHINE\Software\Test\Key")
    If IsArray(strTest) = True Then
        For intLoop = LBound(strTest) To UBound(strTest)
            MsgBox strTest(intLoop)
        Next intLoop
    End If
End Sub
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now