Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. deleting folder containting files

deleting folder containting files

Scheduled Pinned Locked Moved C / C++ / MFC
questionjson
8 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    neha agarwal27
    wrote on last edited by
    #1

    Hi all, I have a folder and in that i have some files, i want to delete that folder with files and for doing so i am using RemoveDirectory api.... but it is not deleting my folder... How can i do it???? Thanks in advance

    S K T H 4 Replies Last reply
    0
    • N neha agarwal27

      Hi all, I have a folder and in that i have some files, i want to delete that folder with files and for doing so i am using RemoveDirectory api.... but it is not deleting my folder... How can i do it???? Thanks in advance

      S Offline
      S Offline
      Shirani
      wrote on last edited by
      #2

      Try this in CMD rd /s FOLDER i think it will work

      Regards: Xohaib Shirani

      N 1 Reply Last reply
      0
      • S Shirani

        Try this in CMD rd /s FOLDER i think it will work

        Regards: Xohaib Shirani

        N Offline
        N Offline
        neha agarwal27
        wrote on last edited by
        #3

        But i want to do it through coding...

        D 1 Reply Last reply
        0
        • N neha agarwal27

          Hi all, I have a folder and in that i have some files, i want to delete that folder with files and for doing so i am using RemoveDirectory api.... but it is not deleting my folder... How can i do it???? Thanks in advance

          K Offline
          K Offline
          kakan
          wrote on last edited by
          #4

          See Here[^] Edit: Sorry, that was the CE-version. See Here instead[^] An interesting piece of information from that page is: To recursively delete the files in a directory, use the SHFileOperation function.

          Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

          1 Reply Last reply
          0
          • N neha agarwal27

            Hi all, I have a folder and in that i have some files, i want to delete that folder with files and for doing so i am using RemoveDirectory api.... but it is not deleting my folder... How can i do it???? Thanks in advance

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            See SHFileOperation/rmdir or deletefile.

            1 Reply Last reply
            0
            • N neha agarwal27

              Hi all, I have a folder and in that i have some files, i want to delete that folder with files and for doing so i am using RemoveDirectory api.... but it is not deleting my folder... How can i do it???? Thanks in advance

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              have you only checked the API Documentation[^] ? "lpPathName : The path of the directory to be removed. This path must specify an empty directory, and the calling process must have delete access to the directory. " down further the page, you can see this : "To recursively delete the files in a directory, use the SHFileOperation[^] function." next time, google before asking please

              [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

              P 1 Reply Last reply
              0
              • N neha agarwal27

                But i want to do it through coding...

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                While you can do what Shirani's suggests via code, it's definitely the wrong aproach.

                "Love people and use things, not love things and use people." - Unknown

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                1 Reply Last reply
                0
                • T toxcct

                  have you only checked the API Documentation[^] ? "lpPathName : The path of the directory to be removed. This path must specify an empty directory, and the calling process must have delete access to the directory. " down further the page, you can see this : "To recursively delete the files in a directory, use the SHFileOperation[^] function." next time, google before asking please

                  [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                  P Offline
                  P Offline
                  platso_588
                  wrote on last edited by
                  #8

                  I like to Delete folder in any case even if other applications or other users are accessing the same folder. Forcefully i like to delete the Folder. I receive Error 32 when the function SHFileOperation(). Can any one tell me how can i acheive this.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups