Sideway
output.to from Sideway
Draft for Information Only

Content

Folder Object
FolderObject.Size Property
   Syntax:
   Parameters:
   Returns:
   Remarks:
   Examples:
FolderObject.Drive Property
   Syntax:
   Parameters:
   Returns:
   Remarks:
   Examples:
FolderObject.IsRootFolder Property
   Syntax:
   Parameters:
   Returns:
   Remarks:
   Examples:
FolderObject.Name Property
   Syntax:
   Parameters:
   Returns:
   Remarks:
   Examples:
FolderObject.Path Property
   Syntax:
   Parameters:
   Returns:
   Remarks:
   Examples:

Folder Object

One key function of FileSystemObject Component is the manipulation of folders of the file system.

FolderObject.Size Property

FolderObject.Size property is a property to to get the total size, in bytes, for all files and subfolders contained in the specified folder object instance.

Syntax:

FolderObjectName.Size

 Or in VBScript. Imply

foldersize =FolderObjectName.Size

 Or in JScript. Imply

foldersize =FolderObjectName.Size

Parameters:

foldersize

The parameter "foldersize" is the name assigned to the value returned by the size property referred to the specified Folder object.

FolderObjectName

The parameter "FolderObjectName" is used to specify the name of the instance of the Folder Object related to.

Returns:

Value

The return value of the size property is a value in bytes, for all files and subfolders contained in the specified folder object instance.

Remarks:

FolderObjectName refers to a Folder Object. And File object is another possible alternate object for the Size property.

Examples:

  • Example of using the Size property to get the total size of a folder.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, FolderObjectName, foldersize
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FolderObjectName = fso.GetFolder("d:\temp")
    foldersize = FolderObjectName.Size
    Response.Write foldersize & "<br />"
    </script>

    HTML web page ouput:

    2600063969

  • Example of using the Size property to get the total size of a folder.

    ASP JScript command:

    <script runat="server" language="JScript">
    var fso, FolderObjectName, foldersize;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    FolderObjectName = fso.GetFolder("d:\\temp");
    foldersize = FolderObjectName.Size 
    Response.Write (foldersize+ "<br />");
    </script>

    HTML web page ouput:

    2600063969

FolderObject.Drive Property

FolderObject.Drive property is a read only property to get and return the drive letter on which the specified folder object instance resided.

Syntax:

FolderObjectName.Drive

 Or in VBScript. Imply

driveletter =FolderObjectName.Drive

 Or in JScript. Imply

driveletter =FolderObjectName.Drive

Parameters:

driveletter

The parameter "driveletter" is the name assigned to the drive letter returned by the drive property referred to the specified Folder object.

FolderObjectName

The parameter "FolderObjectName" is used to specify the name of the instance of the Folder Object related to.

Returns:

string

The return value of the drive property is a string of  the letter name representation of the drive on which the specified folder object instance resided.

Remarks:

FolderObjectName refers to a Folder Object. And File object is another possible alternate object for the Drive property.

Examples:

  • Example of using the Drive property to get the drive letter of a folder.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, FolderObjectName, driveletter
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FolderObjectName = fso.GetFolder("d:\temp")
    driveletter = FolderObjectName.Drive
    Response.Write driveletter & "<br />"
    </script>

    HTML web page ouput:

    d:

  • Example of using the Drive property to get the drive letter of a folder.

    ASP JScript command:

    <script runat="server" language="JScript">
    var fso, FolderObjectName, driveletter;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    FolderObjectName = fso.GetFolder("d:\\temp");
    driveletter = FolderObjectName.Drive 
    Response.Write (driveletter+ "<br />");
    </script>

    HTML web page ouput:

    d:

FolderObject.IsRootFolder Property

FolderObject.IsrootFolder property is a property to check and return a value indictating whether the specified folder object instance is a root folder or not.

Syntax:

FolderObjectName.IsRootFolder

 Or in VBScript. Imply

rootfolderflag =FolderObjectName.IsRootFolder

 Or in JScript. Imply

rootfolderflag =FolderObjectName.IsRootFolder

Parameters:

rootfolderflag

The parameter "rootfolderflag" is the name assigned to the boolean value returned by the IsRootFolder property referred to the specified Folder object.

FolderObjectName

The parameter "FolderObjectName" is used to specify the name of the instance of the Folder Object related to.

Returns:

boolean value

The return value of the IsRootFolder property is a boolean value to indicate whether the specified folder object instance is a roof folder or not. IsRootFolder property returns True only when the specified folder is the root folder and returns False if the specified folder is not.

Remarks:

FolderObjectName refers to a Folder Object.

Examples:

  • Example of using the IsRootFolder property to check whether a folder is the root folder or not.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, FolderObjectName, rootfolderflag
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FolderObjectName = fso.GetFolder("d:\temp")
    rootfolderflag= FolderObjectName.IsRootFolder
    Response.Write rootfolderflag & "<br />"
    </script>

    HTML web page ouput:

    False

  • Example of using the IsRootFolder property to check whether a folder is the root folder or not.

    ASP JScript command:

    <script runat="server" language="JScript">
    var fso, FolderObjectName, rootfolderflag;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    FolderObjectName = fso.GetFolder("d:\\temp");
    rootfolderflag = FolderObjectName.IsRootFolder
    Response.Write (rootfolderflag+ "<br />");
    </script>

    HTML web page ouput:

    false

FolderObject.Name Property

FolderObject.Name property is a read/write property to set and return the name of the specified folder object instance.

Syntax:

FolderObjectName.Name [= newname]

 Or in VBScript. Imply

foldername =FolderObjectName.Name

 FolderObjectName.Name =newfoldername

 Or in JScript. Imply

foldername =FolderObjectName.Name

 FolderObjectName.Name =newfoldername

Parameters:

foldername

The parameter "foldername" is the name assigned to the string returned by the Name property referred to the specified Folder object.

FolderObjectName

The parameter "FolderObjectName" is used to specify the name of the instance of the Folder Object related to.

newfoldername

The optional parameter "newfoldername" is used to specify the new folder name to be assigned by the Name property to the folder name referred to the specified Folder object.

Returns:

string

The return value of the Name property is the string of existing folder name refered to the specified folder object instance.

Remarks:

FolderObjectName refers to a Folder Object.  And File object is another possible alternate object for the Name property.

Examples:

  • Example of using the Name property to get and set the name of the specified folder.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, FolderObjectName, foldername
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FolderObjectName = fso.GetFolder("d:\temp")
    foldername= FolderObjectName.Name
    Response.Write foldername & "<br />"
    FolderObjectName.Name="tempa"
    Response.Write  FolderObjectName.Name & "<br />"
    </script>

    HTML web page output

    temp
    tempa

  • Example of using the Name property to get and set the name of the specified folder.

    ASP JScript command:

    <script runat="server" language="JScript">
    var fso, FolderObjectName, foldername;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    FolderObjectName = fso.GetFolder("d:\\temp");
    foldername = FolderObjectName.Name
    Response.Write (foldername+ "<br />");
    FolderObjectName.Name ="tempa"
    Response.Write (FolderObjectName.Name+ "<br />");
    </script>

    HTML web page outputML web page output

    temp
    tempa

FolderObject.Path Property

FolderObject.Path property is a property to get and return the path of the specified folder object instance.

Syntax:

FolderObjectName.Path

 Or in VBScript. Imply

folderpath =FolderObjectName.Path

 Or in JScript. Imply

folderpath =FolderObjectName.Path

Parameters:

folderpath

The parameter "folderpath" is the name assigned to the string returned by the Name property referred to the specified Folder object.

FolderObjectName

The parameter "FolderObjectName" is used to specify the name of the instance of the Folder Object related to.

Returns:

string

The return value of the Path property is the string of path refered to the specified folder object instance.

Remarks:

FolderObjectName refers to a Folder Object.  And File and Drive objects are another possible alternate objects for the Path property.

Examples:

  • Example of using the Path property to get the path of the specified folder.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, FolderObjectName, folderpath
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FolderObjectName = fso.GetFolder("d:\temp")
    folderpath= FolderObjectName.Path
    Response.Write folderpath & "<br />"
    </script>

    HTML web page output

    D:\temp

  • Example of using the Path property to get the path of the specified folder.

    ASP JScript command:

    <script runat="server" language="JScript">
    var fso, FolderObjectName, folderpath;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    FolderObjectName = fso.GetFolder("d:\\temp");
    folderpath = FolderObjectName.Path
    Response.Write (folderpath+ "<br />");
    </script>

    HTML web page output

    D:\temp


©sideway

ID: 130500003 Last Updated: 5/8/2013 Revision: 0 Ref:

close

References

  1. Active Server Pages,  , http://msdn.microsoft.com/en-us/library/aa286483.aspx
  2. ASP Overview,  , http://msdn.microsoft.com/en-us/library/ms524929%28v=vs.90%29.aspx
  3. ASP Best Practices,  , http://technet.microsoft.com/en-us/library/cc939157.aspx
  4. ASP Built-in Objects,  , http://msdn.microsoft.com/en-us/library/ie/ms524716(v=vs.90).aspx
  5. Response Object,  , http://msdn.microsoft.com/en-us/library/ms525405(v=vs.90).aspx
  6. Request Object,  , http://msdn.microsoft.com/en-us/library/ms524948(v=vs.90).aspx
  7. Server Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525541(v=vs.90).aspx
  8. Application Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525360(v=vs.90).aspx
  9. Session Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms524319(8v=vs.90).aspx
  10. ASPError Object,  , http://msdn.microsoft.com/en-us/library/ms524942(v=vs.90).aspx
  11. ObjectContext Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525667(v=vs.90).aspx
  12. Debugging Global.asa Files,  , http://msdn.microsoft.com/en-us/library/aa291249(v=vs.71).aspx
  13. How to: Debug Global.asa files,  , http://msdn.microsoft.com/en-us/library/ms241868(v=vs.80).aspx
  14. Calling COM Components from ASP Pages,  , http://msdn.microsoft.com/en-us/library/ms524620(v=VS.90).aspx
  15. IIS ASP Scripting Reference,  , http://msdn.microsoft.com/en-us/library/ms524664(v=vs.90).aspx
  16. ASP Keywords,  , http://msdn.microsoft.com/en-us/library/ms524672(v=vs.90).aspx
  17. Creating Simple ASP Pages,  , http://msdn.microsoft.com/en-us/library/ms524741(v=vs.90).aspx
  18. Including Files in ASP Applications,  , http://msdn.microsoft.com/en-us/library/ms524876(v=vs.90).aspx
  19. ASP Overview,  , http://msdn.microsoft.com/en-us/library/ms524929(v=vs.90).aspx
  20. FileSystemObject Object,  , http://msdn.microsoft.com/en-us/library/z9ty6h50(v=vs.84).aspx
  21. http://msdn.microsoft.com/en-us/library/windows/desktop/ms675944(v=vs.85).aspx,  , ADO Object Model
  22. ADO Fundamentals,  , http://msdn.microsoft.com/en-us/library/windows/desktop/ms680928(v=vs.85).aspx
close

Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Reference 79

Computer

Hardware 249

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 429

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019