Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Location
    India
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating directories

    Is it possible to create directories in asp?

    Thanks.

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes it is. do some searching about FSO

    more info from helpfile:
    ----------------------

    The following example demonstrates how to use the Folder and FileSystemObject objects to manipulate folders and gain information about them in VBScript:


    Sub ShowFolderInfo()
    Dim fso, fldr, s
    ' Get instance of FileSystemObject.
    Set fso = CreateObject("Scripting.FileSystemObject")
    ' Get Drive object.
    Set fldr = fso.GetFolder("c:")
    ' Print parent folder name.
    Response.Write "Parent folder name is: " & fldr & "<br>"
    ' Print drive name.
    Response.Write "Contained on drive " & fldr.Drive & "<br>"
    ' Print root file name.
    If fldr.IsRootFolder = True Then
    Response.Write "This is the root folder." & ""<br>"<br>"
    Else
    Response.Write "This folder isn't a root folder." & "<br><br>"
    End If
    ' Create a new folder with the FileSystemObject object.
    fso.CreateFolder ("C:\Bogus")
    Response.Write "Created folder C:\Bogus" & "<br>"
    ' Print the base name of the folder.
    Response.Write "Basename = " & fso.GetBaseName("c:\bogus") & "<br>"
    ' Delete the newly created folder.
    fso.DeleteFolder ("C:\Bogus")
    Response.Write "Deleted folder C:\Bogus" & "<br>"
    End Sub

    This example shows how to use the Folder and FileSystemObject objects in JScript:
    function ShowFolderInfo()
    {
    var fso, fldr, s = "";
    // Get instance of FileSystemObject.
    fso = new ActiveXObject("Scripting.FileSystemObject");
    // Get Drive object.
    fldr = fso.GetFolder("c:");
    // Print parent folder name.
    Response.Write("Parent folder name is: " + fldr + "<br>");
    // Print drive name.
    Response.Write("Contained on drive " + fldr.Drive + "<br>");
    // Print root file name.
    if (fldr.IsRootFolder)
    Response.Write("This is the root folder.");
    else
    Response.Write("This folder isn't a root folder.");
    Response.Write("<br><br>");
    // Create a new folder with the FileSystemObject object.
    fso.CreateFolder ("C:\\Bogus");
    Response.Write("Created folder C:\\Bogus" + "<br>");
    // Print the base name of the folder.
    Response.Write("Basename = " + fso.GetBaseName("c:\\bogus") + "<br>");
    // Delete the newly created folder.
    fso.DeleteFolder ("C:\\Bogus");
    Response.Write("Deleted folder C:\\Bogus" + "<br>");
    }

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Location
    India
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, that was of help.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •