GetName.exe uses Windows API functions to get the present User ID and the Computer's Name: GetName.bas Option Explicit ' Form Name: GetName.bas ' Author: Tyler Travis, Eruption Software ' www.travis-usa.com ' Date: 3/16/01 Public Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" ( _ ByVal lpBuffer As String, _ nSize As Long _ ) As Long Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" ( _ ByVal lpBuffer As String, _ ByRef nSize As Long _ ) As Long Public Sub GetCompName() strCompName = String$(compNameSize + 1, 0) ret = GetComputerName(strCompName, compNameSize) intCharPos = InStr(1, strCompName, Chr(0), 0) strNameTrimmed = Left(strCompName, intCharPos - 1) frmGetName.lblAllNames.Caption = strNameTrimmed End Sub Public Sub GetUsersName() strUserName = String$(userNameSize + 1, 0) ret = GetUserName(strUserName, userNameSize) intCharPos = InStr(1, strUserName, Chr(0), 0) strNameTrimmed = Left(strUserName, intCharPos - 1) frmGetName.lblAllNames.Caption = strNameTrimmed End Sub ============================= frmGetName.frm only needs to call the functions: VERSION 5.00 Begin VB.Form frmGetName Caption = " Get Name" ClientHeight = 1590 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 Icon = "frmGetName.frx":0000 LinkTopic = "Form1" ScaleHeight = 1590 ScaleWidth = 4680 StartUpPosition = 3 'Windows Default Begin VB.CommandButton cmdExit Caption = "Exit" Height = 375 Left = 3120 TabIndex = 3 Top = 1080 Width = 1095 End Begin VB.CommandButton cmdGetComputer Caption = "Get Computer" Height = 375 Left = 1680 TabIndex = 2 Top = 1080 Width = 1335 End Begin VB.CommandButton cmdGetName Caption = "Get User" Height = 375 Left = 480 TabIndex = 1 Top = 1080 Width = 1095 End Begin VB.Label lblAllNames Alignment = 2 'Center BackColor = &H00FFFFFF& BorderStyle = 1 'Fixed Single BeginProperty Font Name = "MS Sans Serif" Size = 12 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 480 TabIndex = 0 Top = 480 Width = 3735 End End Attribute VB_Name = "frmGetName" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit ' Form Name: frmGetName.frm ' Author: Tyler Travis, Eruption Software ' www.travis-usa.com ' Date: 3/16/01 Private Sub cmdExit_Click() Unload Me End Sub Private Sub cmdGetComputer_Click() GetCompName End Sub Private Sub cmdGetName_Click() GetUsersName End Sub ============================= GetNames.vbp: Type=Exe Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT\System32\stdole2.tlb#OLE Automation Module=GetName; GetName.bas Form=frmGetName.frm IconForm="frmGetName" Startup="frmGetName" HelpFile="" Title="GetNames" ExeName32="GetName3.exe" Command32="" Name="GetNames" HelpContextID="0" CompatibleMode="0" MajorVer=1 MinorVer=0 RevisionVer=1 AutoIncrementVer=0 ServerSupportFiles=0 VersionComments="APIs only." VersionCompanyName="Eruption Software and Tyler Travis." CompilationType=0 OptimizationType=0 FavorPentiumPro(tm)=0 CodeViewDebugInfo=0 NoAliasing=0 BoundsCheck=0 OverflowCheck=0 FlPointCheck=0 FDIVCheck=0 UnroundedFP=0 StartMode=0 Unattended=0 Retained=0 ThreadPerObject=0 MaxNumberOfThreads=1