Re: Delete folder



If the directory is empty then RmDir works fine.
If the directory has files then you need to Kill all
files in the directory then use RmDir
This will give error if any of the files are in use, so
you need to add error handling.
Kill "C:\Temp\*.*"
RmDir "C:\Temp"


If the directory has files and sub directories then better
use the SHFileOperation API, with option to delete to
the Recycle Bin or not. The API has it is own error handling.





"David" <dlchase@xxxxxxxxxxxxxxx> wrote in message
news:eWP0eYVDGHA.208@xxxxxxxxxxxxxxxxxxxxxxx
> Is there any built-in function in VB6 that allows me to delete a folder on
> the network without using filesystemobject? I have a routine that moves
> files from one folder to another and I need to remove the "source" folder
> after all files are moved to the "destination" folder. I know there is a
> Kill command but that is for files. Thanks.
>
> David
>


.



Relevant Pages

  • Re: Unable to delete folder
    ... Help - Kill - See Also. ... RmDir Statement ... directory or folder to be removed. ... This example uses the RmDir statement to remove an existing directory or ...
    (comp.databases.ms-access)
  • Copy files/folders
    ... What commandswould be used to copy a single folder, using VBA, from one ... I find that RMDIR, MKDIR, and KILL all work with ...
    (microsoft.public.access.formscoding)
  • Re: Importing and Appending Multiple Excel workbook data into Acce
    ... This is very cool....I have tried both and the kill process is a neat one... ... Try this code to do the import.- replace the Const ... Dim myXLS As String ... snag a folder full of imports. ...
    (microsoft.public.access.externaldata)
  • Re: Contacts Folder
    ... "Kill" wrote in message ... > Outlook and Activesyn for my pocketpc haven't been playing well lately. ... >> the one that says "Folder List?" ... >> Russ Valentine ...
    (microsoft.public.outlook.general)
  • Re: Many File Import
    ... copy the files you want into a temporary folder and import them from ... there (with the Kill statement), ... >>Please respond in the newgroup and not by email. ...
    (microsoft.public.access.externaldata)