Sample Script to get current Windows User's Name:
(Source: This might be from notes.net somewhere.)
Includes:
'-------------------------------------
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (Byval
lpBuffer As String, nSize As Long) As Long
'-------------------------------------
'-------------------------------------
Dim lpBuff As String * 25
Dim ret As Long
ret = GetUserName(lpBuff, 25)
UserName = Ucase(Left(lpBuff, Instr(lpBuff, Chr(0)) - 1))
Msgbox "User name: " + UserName
'-------------------------------------
previous page
|