Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

Link:http://output.to/sideway/default.asp?qno=130500004

ShortName / ShortPath / Type / Attributes, Folder Object, ASP Server Component, Built-in Function

Folder Object

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

FolderObject.ShortName Property

FolderObject.ShortName property is a property to get and return the short name converntion for programs that require the earlier 8.3  naming format of the specified folder object instance.

Syntax:

FolderObjectName.ShortName

 Or in VBScript. Imply

foldershortname =FolderObjectName.ShortName

 Or in JScript. Imply

foldershortname =FolderObjectName.ShortName

Parameters:

foldershortname

The parameter "foldershortname" is the name assigned to the string returned by the ShortName 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 ShortName property is the string of the 8.3 naming convention of a 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 ShortName property.

Examples:

  • Example of using the ShortName property to get the shortname of the specified folder.

    ASP VBScript command:

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

    HTML web page output

    templongname
    TEMPLO~1

  • Example of using the ShortName property to get the shortname of the specified folder.

    ASP JScript command::

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

    HTML web page output

    templongname
    TEMPLO~1

FolderObject.ShortPath Property

FolderObject.ShortPath property is a property to get and return the short path converntion for programs that require the earlier 8.3  naming format, of the specified folder object instance.

Syntax:

FolderObjectName.ShortPath

 Or in VBScript. Imply

foldershortpath =FolderObjectName.ShortPath

 Or in JScript. Imply

foldershortpath =FolderObjectName.ShortPath

Parameters:

foldershortpath

The parameter "foldershortpath" is the name assigned to the string returned by the ShortName 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 ShortPath property is the string of the 8.3 naming convention of the path refered to the specified folder object instance.

Remarks:

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

Examples:

  • Example of using the ShortPath property to get the short path format of the path of the specified folder.

    ASP VBScript command:

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

    HTML web page output

    D:\templongname
    D:\TEMPLO~1

  • Example of using the ShortPath property to get the short path format of the path of the specified folder.

    ASP JScript command:

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

    HTML web page output

    D:\templongname
    D:\TEMPLO~1

FolderObject.Type Property

FolderObject.Type property is a property to get and return the information type of the specified folder object instance.

Syntax:

FolderObjectName.Type

 Or in VBScript. Imply

foldertype =FolderObjectName.Type

 Or in JScript. Imply

foldertype =FolderObjectName.Type

Parameters:

foldertype

The parameter "foldertype" is the name assigned to the string returned by the Type 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 Type property is the string of the information type of the specified folder object instance.

Remarks:

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

Examples:

  • Example of using the Type property to get the information type of the specified folder.

    ASP VBScript command:

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

    HTML web page output

    File Folder

  • Example of using the Type property to get the information type of the specified folder.

    ASP JScript command:

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

    HTML web page output

    File Folder

FolderObject.Attributes Property

FolderObject.Attributes property for folder object is a read/write or read-only property depending on the attribute to set and return the attributes of the specified object instance.

Syntax:

FolderObjectName.Attributes [=newattributes]

 Or in VBScript. Imply

folderattributes =FolderObjectName.Attributes

FolderObjectName.Attributes =newattributes

 Or in JScript. Imply

folderattributes =FolderObjectName.Attributes

FolderObjectName.Attributes =newattributes

Parameters:

folderattributes

The parameter "folderattributes" is the name assigned to the string returned by the Attributes 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.

newattributes

The optional parameter "newattributes" is used to specify the new attributes to be assigned by the Attributes property to the specified Folder object.

Returns:

bitwise value

The return value of the Attributes property is the logical combination of the bitwise the attribute values of the specified folder object instance. The possible bitwise values of the single entry of attributes for any logical combination are.

Value Constant Description
0 Normal Normal file. No attributes are set.
1 ReadOnly Read-only file. Attribute is read/write
2 Hidden Hidden file. Attribute is read/write
4 System System file. Attribute is read/write
8 Volumn Disk drive volume label. Attribute is read-only.
16 Directory Folder or directory. Attribute is read-only.
32 Archive File Has changed since last backup. Attribute is read/write
1024 Alias Link or shortcut. Attribute is read-only.
2048 Compressed Compressed file. Attribute is read-only

Remarks:

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

Examples:

  • Example of using the Attributes property to get and set the attributes of the specified folder.

    ASP VBScript command:

    <script runat="server" language="VBScript">
    Dim fso, FolderObjectName, folderattributes
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set FolderObjectName = fso.GetFolder("d:\temp1")
    folderattributes= FolderObjectName.attributes
    Response.Write folderattributes & "<br />"
    FolderObjectName.Attributes = FolderObjectName.Attributes-2
    Response.Write FolderObjectName.Attributes & "<br />"
    </script>

    HTML web page output

    18
    16

  • Example of using the Attributes property to get and set the attributes of the specified folder.

    ASP JScript command::

    <script runat="server" language="JScript">
    var fso, FolderObjectName, folderattributes;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    FolderObjectName = fso.GetFolder("d:\\temp1");
    folderattributes = FolderObjectName.Attributes
    Response.Write (folderattributes+ "<br />");
    FolderObjectName.Attributes = FolderObjectName.Attributes-2
    Response.Write (FolderObjectName.Attributes+ "<br />");
    </script>

    HTML web page output

    18
    16

Previous Month  MAY  2013  Next Month
SMTWTFS
1234
567891011
12131415161718
19202122232425
262728293031

Previous Month    2010  Next Month
SMTWTFS
12345
6789101112
13141516171819
20212223242526
2728293031

Sideway BICK Blog

09/05


Copyright © 2000-2020 Sideway . All rights reserved Disclaimerslast modified on 26 January 2013