Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem: Does FSO (FileSystemObject) Work on UNC Paths

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

Maybe it is an issue with user rights?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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 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/…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

705 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