CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2001
    Location
    Trutnov, Czech Republic
    Posts
    459

    One question about GetComputerName()

    Hi,

    one question about this function: when I have NT domain and use logon scripts, from witch I call my program, in which I call GetComputerName(), what name will be returned? The one of server on which the logon script and exe file reside, or the one of client computer, on which a user is just logging?

    I have no possibility to check it right now, but I would like to know it.

    Thank you.
    The sun is the same in the relative way, but you're older
    Shorter of breath and one day closer to death


    - Roger Waters, 1973

  2. #2
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    Re: One question about GetComputerName()

    GetComputerName API will return the NetBIOS name of the computer on which this API is executed.

    So, if your program is run on the client computer (via logon script), the API will return the name of the Client.

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: One question about GetComputerName()

    Does this quote from MSDN makes it clearer?
    The GetComputerName function retrieves the NetBIOS name of the local computer. This name is established at system startup, when the system reads it from the registry.

    If the local computer is a node in a cluster, GetComputerName returns the name of the cluster virtual server.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Jul 2001
    Location
    Trutnov, Czech Republic
    Posts
    459

    Re: One question about GetComputerName()

    Thank you very much Siddhartha!
    The sun is the same in the relative way, but you're older
    Shorter of breath and one day closer to death


    - Roger Waters, 1973

  5. #5
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    Re: One question about GetComputerName()

    You are welcome...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured