Delete a Folder

  • Hello,
    I'm looking for a macro to delete a folder. The folder is C:\Documents and Settings\c\Desktop\download\New Package_7


    This folder may / may not be empty.


    Thanks for your help.

    The original point and click interface was a Smith and Wesson.

  • Re: Delete a Folder


    Thanks for your reply, StefanG. I tried the code after editing it to suit my needs. It successfully deletes all files in the folder but leaves behind the empty folder & empty subfolders. This code is still faster than using Kill statements or RmDir but I'm looking for something more efficient which can delete folders and sub folders which may / may not be empty.


    If you think of any other ideas, I would be grateful if you inform me. The code that I edited is below:-

    The original point and click interface was a Smith and Wesson.

  • Re: Delete a Folder


    Hi dgr,
    Good to hear you found some help. - I suppose you could try what was mentioned in the same thread, earlier on.

    Code
    "RmDir "NewPrivateFolder" 
    ' deletes the subfolder NewPrivateFolder in the active folder

    Stefan

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!