Determining a User's Computer Name

Determining a User's Computer Name

Post by David H. L » Wed, 09 Jul 2003 03:34:32


Mark:

KixTart (kix32.exe from http://www.yqcomputer.com/ ) has a macro called @wksta whuch
will return the Workstation name.

Dave
~~~~~~~~~~~~~~~~
;-----------------
; SHORT Greeting
;-----------------
SETCONSOLE("SHOW")
SETCONSOLE("MAXIMIZE")
SETCONSOLE("FOREGROUND")
cls
Color b+/n
BOX (0,0,24,79,GRID)
Color b/n
BOX (8,21,18,61,
Color g+/n
BOX (7,18,17,60,FULL)
;-----------------
Color w+/n
AT (9,20) "Userid : "
AT (10,20) "Full name : "
AT (11,20) "Privilege : "
AT (12,20) "Workstation : "
AT (13,20) "Domain : "
AT (14,20) "Logon Server: "
AT (15,20) "MAC Address : "
AT (16,20) "Dial-Up PPP : "
Color y+/n
AT (9,35) ucase(@userid)
AT (10,35) @fullname
AT (11,35) @priv
AT (12,35) @wksta
AT (13,35) @domain
AT (14,35) rtrim(@lserver)
AT (15,35) @Address
AT (16,35) $RAS
Color w/n
sleep 1
 
 
 

Determining a User's Computer Name

Post by Michael Ho » Wed, 09 Jul 2003 04:47:36

Here is the vbscript way, straight off of script center.

Set objNet = WScript.CreateObject( "WScript.Network" )
'// If this line wraps you need to fix it. Should be one line
msgbox (objNet.ComputerName & " - " & objNet.UserName & " - " &
objNet.UserDomain), vbinformation, "Computer, User, and Domain"

--
Regards,

Michael Holzemer

Please reply in newsgroup
*************************************************