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?
Printable View
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?
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:
If Dir$(strFullPath, vbDirectory) = "" Then 'folder doesn't exist Else 'folder exist End if
VB Code:
if fso.folderexists then else fso.createfolder("c:\test") end if try the above. Hope you get your desire ;)