Atributo Path de ASP

Definición y uso

La propiedad Path se utiliza para devolver la ruta especificada del dispositivo, archivo o carpeta.

Notas:Para los dispositivos, la ruta no incluye el directorio raíz. Por ejemplo, la ruta del dispositivo C es C: en lugar de C:\.

Sintaxis:

DriveObject.Path 
FileObject.Path
FolderObject.Path

Ejemplo para el objeto Drive

<%
dim fs,d
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
Response.Write("La ruta es " & d.Path)
set d=nothing
set fs=nothing
%>

Salida:

La ruta es C:

Ejemplo para el objeto File

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("c:\asp\test\test.asp")
Response.Write("La ruta es: " & f.Path)
set f=nothing
set fs=nothing
%>

Salida:

La ruta es: C:\asp\test\test.asp

Ejemplo para el objeto Folder

<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\asp\test")
Response.Write("La ruta es: " & fo.Path)
set fo=nothing
set fs=nothing
%>

Salida:

La ruta es: C:\asp\test