Solved

Problem: Does FSO (FileSystemObject) Work on UNC Paths

Posted on 2004-04-20
6
1,547 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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 …
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now