Option Explicit Const AppName = "Remote IP" Dim Server Server = InputBox("Enter server name:", AppName) If Len(Server) = 0 Then WScript.Quit Dim Winsock Set Winsock = WScript.CreateObject("MSWinsock.Winsock", "Winsock_") Winsock.Connect Server, 139 Dim Shell Set Shell = WScript.CreateObject("WScript.Shell") MsgBox "Please wait...", vbInformation, AppName Set Winsock = Nothing Set Shell = Nothing Sub Winsock_Connect MsgBox "IP address for " & Server & " is " & _ Winsock.RemoteHostIP, vbInformation, AppName CloseMsgBox End Sub Sub Winsock_Error(Number, Description, Scode, Source, _ HelpFile, HelpContext, CancelDisplay) MsgBox "Error " & Number & vbNewLine & Description, vbCritical, AppName CloseMsgBox End Sub Sub CloseMsgBox Shell.AppActivate AppName Shell.SendKeys "{ESC}" End Sub