Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP ParentFolder Property

ASP ParentFolder Property


File Object Reference Complete File Object Reference Manual


The ParentFolder property returns the parent folder object of a specified file or folder.

Syntax

FileObject.ParentFolder

FolderObject.ParentFolder

Example for the File object

<%

dim fs,f

set fs=Server.CreateObject("Scripting.FileSystemObject")

set f=fs.GetFile("c:\asp\test\test.asp")

Response.Write("The file test.asp is in the folder: ")

Response.Write(f.ParentFolder)

set f=nothing

set fs=nothing

%>

Output:

The file test.asp is in the folder: C:\asp\test

Example for the Folder object

<%

dim fs,fo

set fs=Server.CreateObject("Scripting.FileSystemObject")

set fo=fs.GetFolder("c:\asp\test")

Response.Write("The folder test is in the folder: ")

Response.Write(fo.ParentFolder)

set fo=nothing

set fs=nothing

%>

Output:

The folder test is in the folder: C:\asp


File Object Reference Complete File Object Reference Manual