PC Review


Reply
Thread Tools Rate Thread

Accessibility of a server

 
 
Stefi
Guest
Posts: n/a
 
      8th Feb 2008
Hi All,

I have to check whether a file exists on a remote server or not. DIR works
when the server is accessible, but doesn't reply if connection is broken and
keeps searching the file ad infinitum, I can't even interrupt running the
macro (neither with Esc nor with Task manager).

Is there any way to detect the accessibility of the server before using DIR?

Thanks,
Stefi

 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      8th Feb 2008

I am not on a network to test it, but the FileSystemObject should be able to do it...
'--
Sub ProvidePath()
Dim strPath As String
strPath = "FillInPathToTheFileOnTheServer" '<<<<<
MsgBox ReportFileStatus(strPath)
End Sub
'--
Function ReportFileStatus(ByRef fileSpec As String) as String
Dim fso As Object
Dim msg As String
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(fileSpec)) Then
msg = fileSpec & " exists."
Else
msg = fileSpec & " doesn't exist."
End If
ReportFileStatus = msg
Set fso = Nothing
End Function
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins - check out "List Files" )



"Stefi"
wrote in message
Hi All,
I have to check whether a file exists on a remote server or not. DIR works
when the server is accessible, but doesn't reply if connection is broken and
keeps searching the file ad infinitum, I can't even interrupt running the
macro (neither with Esc nor with Task manager).

Is there any way to detect the accessibility of the server before using DIR?

Thanks,
Stefi

 
Reply With Quote
 
Stefi
Guest
Posts: n/a
 
      8th Feb 2008
Thanks Jim, I immediately start testing, I'll post the result.
Stefi


„Jim Cone” ezt *rta:

>
> I am not on a network to test it, but the FileSystemObject should be able to do it...
> '--
> Sub ProvidePath()
> Dim strPath As String
> strPath = "FillInPathToTheFileOnTheServer" '<<<<<
> MsgBox ReportFileStatus(strPath)
> End Sub
> '--
> Function ReportFileStatus(ByRef fileSpec As String) as String
> Dim fso As Object
> Dim msg As String
> Set fso = CreateObject("Scripting.FileSystemObject")
> If (fso.FileExists(fileSpec)) Then
> msg = fileSpec & " exists."
> Else
> msg = fileSpec & " doesn't exist."
> End If
> ReportFileStatus = msg
> Set fso = Nothing
> End Function
> --
> Jim Cone
> San Francisco, USA
> http://www.realezsites.com/bus/primitivesoftware
> (Excel Add-ins - check out "List Files" )
>
>
>
> "Stefi"
> wrote in message
> Hi All,
> I have to check whether a file exists on a remote server or not. DIR works
> when the server is accessible, but doesn't reply if connection is broken and
> keeps searching the file ad infinitum, I can't even interrupt running the
> macro (neither with Esc nor with Task manager).
>
> Is there any way to detect the accessibility of the server before using DIR?
>
> Thanks,
> Stefi
>
>

 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      8th Feb 2008

Please do.
---
Jim Cone



"Stefi"
<(E-Mail Removed)>
wrote in message
Thanks Jim, I immediately start testing, I'll post the result.
Stefi



 
Reply With Quote
 
urkec
Guest
Posts: n/a
 
      8th Feb 2008
"Stefi" wrote:

> Thanks Jim, I immediately start testing, I'll post the result.
> Stefi


>
> „Jim Cone” ezt *rta:
>
> >
> > I am not on a network to test it, but the FileSystemObject should be able to do it...


> > Is there any way to detect the accessibility of the server before using DIR?
> >


You can also use ping command to check if your server is accesible. Here is
some sample code from Richard Mueller's site:

http://www.rlmueller.net/Programs/Ping2.txt

--
urkec
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessibility =?Utf-8?B?TWFyZw==?= Windows XP Accessibility 0 17th Oct 2005 05:41 AM
Zero Accessibility Spyware Discussion 2 2nd Mar 2005 08:46 PM
cd accessibility =?Utf-8?B?Z3VmZ2h1cg==?= Windows XP Accessibility 1 19th Nov 2004 10:35 PM
Accessibility =?Utf-8?B?YWdvMjE4MA==?= Windows XP Help 2 8th May 2004 03:46 PM
CD Rom Accessibility Carlos_ib Windows XP Hardware 1 16th Oct 2003 08:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:52 PM.