WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

wNT
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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
    File Created: 2001:03:01:13:56:38
    Last Updated: 2001:03:01:13:56:38