Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Deleteing a folder on HD from Access (Access 2000 )

    Not sure if this can be done but I have a request to delete the contents of a folder on a users hard drive from in Access. Basically what they want to be able to do is click a button on a form and have it delete the contents of a folder called C:tempdata. Is this possible? Thanks for the help....

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Deleteing a folder on HD from Access (Access 2000 )

    You should be able to do this using VBA behind the form - one approach is to use the shell command and use the familiar Delete "DOS" command. On the other hand, this sort of automation can have unintended consequences. You might look at the recent thread starting with <post#=367858>post 367858</post#> as an example using the shell command - you can also search for the string "shell command" in the Access forum and find numerous threads discussing the issue further.
    Wendell

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Deleteing a folder on HD from Access (Access 2000 )

    Are you trying to delete a folder or its contents? Your subject says "folder" but your description suggests you're talking about deleting the files in a folder. Deleting just the files is fairly easy and can be done from Access VBA using the Kill statement. That would allow you to clear the files in that folder like this: <pre>Kill "C:tempdata*.*"</pre>

    Charlotte

Posting Permissions

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