OpenRemoteBaseKey

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghriver
    New Member
    • Nov 2007
    • 2

    OpenRemoteBaseKey

    Well i have tried and tried. This seems so simple but i cant get the right variable or syntax.

    Very simple: I need to clear a value in a registry key. Specifically the DefaultPassword value in winlogon. I can set the value to anything except a blank one. Why do i need to do this. The operation terminals (Running XP) use a defaut domain account that has a password of "blank" or no password at all. So when my custom program that handles code updates across the network it will also check DefaultUser, DefaultPassword , DefaultDomain, AdminAutoLogon and set them correctly if some how they are wrong. When i do a remotebasekey.s etvalue("Defaul tPassword","") instead of "blank" showing up in the registry, "Zero-length string" shows up??????? I have dried null and .tostring. Can someone tell me what I am doing wrong. My mind is about to explode.

    Code:
    Dim rk As Microsoft.Win32.RegistryKey = _
            Microsoft.Win32.Registry.LocalMachine.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, strMachineName).OpenSubKey("Software\Microsoft\Windows NT\CurrentVersion\Winlogon", True)
            rk.SetValue("DefaultUserName", Me.textboxDefaultUserName.Text)
            If Me.textboxDefaultPassword.Text = "" Then
                MsgBox("Sorry I can't figure out why I cant set blank passwords yet.", MsgBoxStyle.Information)
            Else
                rk.SetValue("DefaultPassword", Me.textboxDefaultPassword.Text)
            End If
  • ghriver
    New Member
    • Nov 2007
    • 2

    #2
    Someone help, please.

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Well, I don't know anything about it. But since you sound desperate, I'll throw in my two cents' worth.
      • Have you tried using a space instead of an empty string?
      • Are you sure "Zero-length string" is really a problem? Perhaps this is Ok.


      You might also try the Windows or .Net forum for this one, as it's really not anything specific to VB.

      Comment

      Working...