Results 1 to 2 of 2

Thread: Determine Local Machine Name [VB-Script]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2003
    Posts
    308

    Question Determine Local Machine Name [VB-Script]

    I am looking for a very quick and simple way to get the Local Machine Name and store it as a variable in my VB-Script.

    From the Command Line we can simply type “%COMPUTERNAME%”, can this be incorporated into my VB-Script.vbs file somehow?

    Otherwise the only way I can think of is using WMI, I already have a WMI object created so I just need to see how, from that, I can extract the required information.

    I would have accepted a Registry Key however the method must work under both Windows NT4 and NT5 (2K).

    Any help would be appreciated.
    Thanks,

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Re: Determine Local Machine Name [VB-Script]

    VB Code:
    1. Response.write(Request.ServerVariables("SERVER_NAME"))
    If ran locally on your machine, would return localhost
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

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