Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique identifier for each computer

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,
I am trying to write a vb program which requires an unique identifier for each computer.


Is there a way to generate or get an unique identifier for each computer??
 
How about this.
Code:
'------------------------------------------------
'- Macro to get network name of current computer
'------------------------------------------------
'-
Private Declare Function GetComputerName _
    Lib "kernel32" Alias "GetComputerNameA" _
    (ByVal lpBuffer As String, nSize As Long) As Long
Private MyString As String
Private MyName As String
'--------------------------------------------

Sub GET_COMPUTER_NAME()
    MyName = FindComputerName
    MsgBox (MyName)
End Sub
'--------------------------------------------
 Public Function FindComputerName() As String
    MyString = Space(512)
    GetComputerName MyString, Len(MyString)
    FindComputerName = Application.WorksheetFunction.Clean(Trim(MyString))
 End Function
 '-------------------------------------------
Regards
BrianB
** Let us know if you get something that works !
================================
 
....or if using win2K


sub get_computer_name()

my_string$=environ$("Computername")
msgbox(my_string$)

end sub
 
Hi ETID

Good one. Works in 97 too.

Regards
BrianB
** Let us know if you get something that works !
================================
 
Isn't there a unique hardware code for the physical cpu?
if so, can that be used?
if so, how to get that string?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top