Message 1 of 2
Check Remote Server Name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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??