R
Rosanna
I'm pretty new to ASP, so please bear with me...
I'm setting up an ASP web page that includes listing the
files in a folder (which are hyperlinked so
the user can open the files). This folder is located on
another computer so on my webserver, I've got a mapped
drive to that folder called Z:.
I executed the code below code to list the drives on my
webserver, but it only shows physical drives - A,C, and D
(cd-rom). Therefore, I can't access files on the Z drive
if it doesn't detect it! I know it's been done before
with a small ListFiles program I found online and on
another older webserver, so there must be something I'm
missing..
Also, I'm not sure this this has anything to do with it,
but I'm logging into the webserver via Remote Desktop to
modify files. I mapped a drive this way, but when I went
to the actual webserver, the mapped drive didn't show up!
I did map the drive, but I'm still having problems
accessing it through the web.
The error that shows up on the web is pretty
undescriptive:
Microsoft VBScript runtime error '800a004c'
Path not found
/index.asp, line 238
I'd would appreciate advice and comments. Thanks!
<%
Dim fso, connectedDrives, drv
Dim strInfo, driveName
Set fso = Server.CreateObject
("Scripting.FileSystemObject")
Set connectedDrives = fso.drives
On Error Resume Next
For Each drv In connectedDrives
strInfo = strInfo & drv.DriveLetter & ": "
' Check if the drive is shared
If drv.DriveType = 3 Then
driveName = drv.ShareName
Else
driveName = drv.VolumeName
End If
strInfo = strInfo & driveName
strInfo = strInfo & " Free space: " &
drv.FreeSpace
If drv.IsReady Then
strInfo = strInfo & " ready" & "<br>"
Else
strInfo = strInfo & " not ready" & "<br>"
End If
Next
Response.Write strInfo & "<br>"
Set connectedDrives = Nothing
Set fso = Nothing
%>
I'm setting up an ASP web page that includes listing the
files in a folder (which are hyperlinked so
the user can open the files). This folder is located on
another computer so on my webserver, I've got a mapped
drive to that folder called Z:.
I executed the code below code to list the drives on my
webserver, but it only shows physical drives - A,C, and D
(cd-rom). Therefore, I can't access files on the Z drive
if it doesn't detect it! I know it's been done before
with a small ListFiles program I found online and on
another older webserver, so there must be something I'm
missing..
Also, I'm not sure this this has anything to do with it,
but I'm logging into the webserver via Remote Desktop to
modify files. I mapped a drive this way, but when I went
to the actual webserver, the mapped drive didn't show up!
I did map the drive, but I'm still having problems
accessing it through the web.
The error that shows up on the web is pretty
undescriptive:
Microsoft VBScript runtime error '800a004c'
Path not found
/index.asp, line 238
I'd would appreciate advice and comments. Thanks!
<%
Dim fso, connectedDrives, drv
Dim strInfo, driveName
Set fso = Server.CreateObject
("Scripting.FileSystemObject")
Set connectedDrives = fso.drives
On Error Resume Next
For Each drv In connectedDrives
strInfo = strInfo & drv.DriveLetter & ": "
' Check if the drive is shared
If drv.DriveType = 3 Then
driveName = drv.ShareName
Else
driveName = drv.VolumeName
End If
strInfo = strInfo & driveName
strInfo = strInfo & " Free space: " &
drv.FreeSpace
If drv.IsReady Then
strInfo = strInfo & " ready" & "<br>"
Else
strInfo = strInfo & " not ready" & "<br>"
End If
Next
Response.Write strInfo & "<br>"
Set connectedDrives = Nothing
Set fso = Nothing
%>