Solved

Problem: Does FSO (FileSystemObject) Work on UNC Paths

Posted on 2004-04-20
6
1,598 Views
Last Modified: 2008-02-07
Hi all,

I am trying to find out if a file exists on several network drives (using UNC paths). Im using the following code:

Function ReportFileStatus(filespec)
      Dim fso, msg
      Set fso = CreateObject("Scripting.FileSystemObject")
      If (fso.FileExists(filespec)) Then
            msg = True
      Else
            msg = False
      End If
      ReportFileStatus = msg
End Function

I call the function with: lEx = ReportFileStatus(strFullUNC) where strFullUnc is something like: "\\CMP100\[share]\[file]"

Somehow, i always get False as a result while i know for sure that the file exists (for testing). Does FSO not work on UNC Paths ?? And if not, is there an other way of getting this info ??
I do know for sure it isn't a security permissions issue, because i'm a authenticated user on the site running the ASP page and on the machine i'm trying to get the FSO to work on.

Thanks in advance,

Peter
0
Comment
Question by:ptijsma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 5

Expert Comment

by:chaniewskim
ID: 10867294
I checked and it works (for a share on my local computer as well as on remote).
Are sure your UNC is ok?
0
 

Author Comment

by:ptijsma
ID: 10867792
Yes, when i run the script, i also display the variable which i send to the function (strFullUNC),
When i copy this string and paste it on the server in a run dialog, it gives me exactly what i want: the file in question.
I cant find anything in the eventlog on both the server or my workstation (to which the UNC path resolves for this test
)

I also tried to use lEx = ReportFileStatus("C:\AUTOEXEC.BAT") and that works fine.

I'm using IIS6 on Windows Server 2003, i don't know if it could be an issue in there ?
0
 
LVL 5

Accepted Solution

by:
chaniewskim earned 500 total points
ID: 10867848
I'm using the same configuration.

Maybe it is an issue with user rights?
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Comment

by:ptijsma
ID: 10867899
On the share i've got "Everyone" -> "Full Control" and the same on NTFS Rights so that's not an issue.
I'm also a Authenticated user (my domain userid) on the website running the ASP page so beeing my own user, i should be able to do this on my own share.

I'm also trying to get a list of files from the share but get the message:
----------------
Microsoft VBScript runtime error '800a004c'

Path not found

/chkBsp.asp, line 19
----------------
And i am Absolute sure the UNC path is correct ("\\TCP-NOTEBOOK2\TestShare")
0
 

Author Comment

by:ptijsma
ID: 10868228
One addition:

I've did some more testing and discovered that UNC paths to local (hidden) shares (c$ etc) DO work but UNC paths to ANY other machine (Server OR Workstation) won't work. So probably it will be security related but i cant find how or why (+ why dont i see anything in the event log??)
0
 

Author Comment

by:ptijsma
ID: 10947046
Solution found:

Problem was the authorisation setting in IIS.
This was NT Auhorisation and MUST be Basic (Plain Text) in order for FSO to work,

Thanks all
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Downside of adding characters set in ASP pages 6 45
Weighted Randomizing 6 38
Html value of radio 14 55
MS SQL + date 6 54
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question