Need ActiveX script to identify ServerName

  • Anyone have an ActiveX VBScript which will render the name of the Server which SQL Server is running on?

    BT
  • There is an extended Stored Procedure

    xp_getnetname that will give you the machine name.

  • VBscript: Copy and paste it in the file with extention .vbs Double-click to run.

    Works on Windows XP and should on Windows 2003 Server. Not sure if it will work on Windows 2000 computer

    Set objComputer = CreateObject("Shell.LocalMachine")

    MsgBox(objComputer.MachineName)

    Set objComputer = Nothing

     

    Regards,Yelena Varsha

  • Or:

    Set objComputer = CreateObject("WScript.NetWork")

    MsgBox(objComputer.ComputerName)

    Set objComputer = Nothing

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply