3

According to the websites I could find the below code should work. If I change the path to C:\whats_new.txt it works just fine.

Const Filename = "\\SCPAFS1PW\returns\whats_new.txt"    ' file to read
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0

' Create a filesystem object
Dim FSO
set FSO = server.createObject("Scripting.FileSystemObject")

' Map the logical path to the physical system path
Dim Filepath
Filepath = Filename

if FSO.FileExists(Filepath) Then <--This always returns false
Doug Chamberlain
  • 11,192
  • 9
  • 51
  • 91

2 Answers2

2

The system reports the file does not exist. In fact it was actually a permissions issue. Microsoft designed the error so that if you do not have permission you cannot fish to figure out file names on a folder.

I modified my permisions to the directory and I was able to access it using a UNC path.

Doug Chamberlain
  • 11,192
  • 9
  • 51
  • 91
0

asp Classic does not (by default) use the Application Pool id for authentication - To set the username for iis follow these steps: on IIS select the website / application you wish to change: Double Click on Authentication Click on Anonymous Authentication and then click edit You can either set a specific user or select the Application pool identity