Check Remote Server Name

Check Remote Server Name

Amremad
Collaborator Collaborator
425 Views
1 Reply
Message 1 of 2

Check Remote Server Name

Amremad
Collaborator
Collaborator
    Dim oShell As Object
    Set oShell = CreateObject("Shell.Application")
    
    MsgBox Not CBool(oShell.NameSpace(CVar("\\ServerName")) Is Nothing)

 or

 

Private Declare Function PathIsDirectory Lib "Shlwapi" Alias "PathIsDirectoryW" (ByVal lpszPath As Long) As Long

Public Function DirExists(ByVal sDirName As String) As Boolean
  DirExists = (PathIsDirectory(StrPtr(Trim$(sDirName))) <> 0)
End Function

 this is two ways to check if server exist or not

but my a problem :

if server isn't exist this code talk long time and make my computer hung every time in (three or four time for ex.)

 

can i fix this problem??

 

 

0 Likes
426 Views
1 Reply
Reply (1)
Message 2 of 2

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

you might use PING to see if the server is alive and can be found before you start any connections to it (>>>click<<<).

BTW: what has this question to do with "AutoCAD customization"?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes