Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem: Does FSO (FileSystemObject) Work on UNC Paths

Posted on 2004-04-20
6
Medium Priority
?
1,686 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 1000 total points
ID: 10867848
I'm using the same configuration.

Maybe it is an issue with user rights?
0
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!

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

963 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