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
Solved

Problem: Does FSO (FileSystemObject) Work on UNC Paths

Posted on 2004-04-20
6
1,582 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
  • 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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 information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

790 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