Results 1 to 2 of 2

Thread: Registry Access WinNT Vs Win95/98

  1. #1

    Thread Starter
    Hyperactive Member razzaj's Avatar
    Join Date
    Oct 1999
    Location
    jounieh
    Posts
    261
    I have already tried to code registry manipulating functions under win95/98 ... but I was wondering if the same code works on an NT Work Station ...???

    If so ... how does one retrieve the Username and Password
    logged on the starting of win NT (the pass and userName one puts whe win NT Starts up)

    Any Help is greatly apreciated
    - regards -
    - razzaj -

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    The registry api's (regopenkey, regclosekey, regqueryvalueex etc.) will work under nt, but expect some differences in the location the values are stored. Several keynames are different.
    To get the username, use the GetUserName API.
    Code:
    Option Explicit
    Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    
    Private Sub Command1_Click()
    Dim sUserName As String
    Dim retVal As Long
    Dim lSize As Long
        lSize = 255
        sUserName = Space(lSize + 1)
        retVal = GetUserName(sUserName, lSize)
        sUserName = Left(sUserName, lSize)
        MsgBox sUserName
    End Sub
    Forget about the password. There is no way to get this.(unless you are specialised in hacking c2 level security)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width