Results 1 to 2 of 2

Thread: reading registry key values in VBScript

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    RTP, NC
    Posts
    3

    Cool

    Can someone please help me? I am trying to read the registry on Windows NT Server 4.0 using VBScript. I would rather not have to use API calls unless it is absolutely necessary. I am trying to get the machines 'computer name' under the identification tab of the Network Neighborhood Properties. I have it located in the registry, but it seems that my scripts do not work properly. Please help...

    [email protected]


    thanks

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    You can't directly read from the registry thru VBScript/ASP, you'll need a component to do that for you

    fortunately, you can use the Scripting Object Model to do this for you, and I have whipped up some ASP code to show you how

    Code:
    <%@Language=VBScript EnableSessionState=False%>
    <% option explicit %>
    <html>
    <body>
    <%
        
        Dim objNetwork
        
        Set objNetwork = Server.CreateObject("WScript.Network")
        
        Response.Write "Computer Name:  " & objNetwork.ComputerName
        
        Set objNetwork = Nothing
    %>
    
    </body>
    </html>

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