Windows-Umgebungsvariable auslesen:
UserName = Trim(Environ("USERNAME"))
Win-Api:
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (Byval lpBuffer As String, nSize As Long) As Long
Dim RetVal As Long
Dim Puffer As String * 256
RetVal = GetUserName(Puffer, Len(Puffer))
If RetVal <> 0 Then
UserName = Trim(Left$(Puffer, Instr(1, Puffer, Chr(0)) - 1))
End If