Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Get the Currently Logged on User in NT

Keywords: 	 current logged on user NT

Question:

Get the current Logged-on user from Windows NT? (preferably registry)

I searched your database and found out how for Win 95 but I didn't see anything for NT.

Answer:

  1. Running from the users own session???
    AddExtender("wwwnt34I.dll")
    user =wntGetUser(@default)
    Message("I am",user)
    
  2. There is also the wntCurrUsers function that *may* be helpful if you are trying to run as a service or something.

  3. In NT:
    HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon[DefaultUserName]
    

    In Win9x:

    HKLM\Network\logon[Username] 
    
    is the name of the last interactively logged on user.
    Article ID:   W14642
    
    Filename:   Get the Currently Logged on User in NT.txt