Thread: deleting a folder AND copying a folder

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    114

    Wink deleting a folder AND copying a folder

    hi experts,
    2 simple questions

    - how do i delete a whole folder?? (programmically)
    - how do i copy a whole folder?? (programmically)


    using
    - API ( no MFC )
    - VC++6.0
    - win98



  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    The easiest way is to use SHFileOperation().

    Search the boards for that function, there are numerous examples.

    gg

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    To use SHFileOperation() under Windows 98, you need this.

    An alternative is to use FindFirstFile()/FindNextFile() to retrieve the files in a directory, use DeleteFile() to delete them, them RemoveDirectory() to get rid of the directory, or CreateDirectory() and then CopyFile() to copy. You can use this approach without the MSLU.

    I have a three part tutorial on the use of FindFirstFile()/FindNextFile() starting here. If the site 404's try again later, there is something wrong with my server.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Copying a whole directory and its content
    By Enira in forum C Programming
    Replies: 4
    Last Post: 03-12-2006, 02:13 PM
  2. Copying a file
    By shivam in forum Windows Programming
    Replies: 2
    Last Post: 12-22-2003, 02:15 PM
  3. Copying an entire directory
    By Brian in forum Windows Programming
    Replies: 6
    Last Post: 07-20-2002, 11:35 AM