Results 1 to 3 of 3

Thread: FSO.createfolder

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    15

    FSO.createfolder

    Alright; I have the statement.
    -- fso.CreateFolder(c:\test")
    in my project, but I need it to overwrite the folder if it exists.
    How can I accomplish this?

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: FSO.createfolder

    Folder is not a text file so why do you need to recreate one? In any caes you have to delete all files in the folder before you could delete folder itself.
    Use Dir$ function to check if folder exist:
    VB Code:
    1. If Dir$(strFullPath, vbDirectory) = "" Then
    2.     'folder doesn't exist
    3. Else
    4.     'folder exist
    5. End if

  3. #3
    Addicted Member
    Join Date
    Mar 2005
    Posts
    174

    Re: FSO.createfolder

    VB Code:
    1. if fso.folderexists then
    2.  
    3. else
    4.  
    5. fso.createfolder("c:\test")
    6.  
    7. end if
    8.  
    9.  
    10. try the above. Hope you get your desire ;)

Posting Permissions

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



Click Here to Expand Forum to Full Width