VB.NET - Loop through text file and modify registry on each PC in list

I cannot see why I cant get this to work!
I will have a text file generated from another function with a computer name and password like this:
C001356395,examplepassword

I want to loop through each line, separate the computer name from the password and update the DefaultPassword field in the registry of each remote computer.
My main problem is that it is not connecting to the remote registry of each PC.
Code:
Dim text As String = txtFile.Text
        If text <> "" Then
            Try
                Dim str2 As String = File.OpenText(text).ReadLine
                Dim reader2 As New StreamReader(text)
                Do While Not reader2.EndOfStream
                    str2 = reader2.ReadLine
                    Dim num As Integer = Strings.InStr(str2, ",", CompareMethod.Binary)
                    Dim str3 As String = Strings.Left(str2, (num - 1))
                    Dim str4 As String = Strings.Right(str2, (Strings.Len(str2) - num))
                    MsgBox(str3)
                    Dim regkey As Microsoft.Win32.RegistryKey = RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, str3)
                    regkey.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", True)

                    regkey.SetValue("DefaultPassword", str4, Microsoft.Win32.RegistryValueKind.String)
                Loop
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try

        End If

Open in new window

I think the problem is this part: RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, str3) where str3 is the computer name. The msgbox(str3) correctly shows the computer name.
I have also changed the code to just read a value from the remote computer but it just doesnt seem to connect.
LVL 2
fruitloopyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fruitloopyAuthor Commented:
Just for future reference and hopefully it may help someone else who is close to slitting their wrists..

In Visual Studio 2012 it has this annoying habit of defaulting to the Wow6432bit node of a 64bit system. You have to remove a tick from the "Prefer 32-bit" box located in:
Project - Properties - Compile
Also make sure the Target CPU is set to AnyCPU
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.