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. RemoveDirectory behaving differently in Xp and 7

RemoveDirectory behaving differently in Xp and 7

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiohelp
2 Posts 2 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.
  • S Offline
    S Offline
    ShadowUz
    wrote on last edited by
    #1

    Hello guys. I want to remove directory using RemoveDirectory("directory path"). I delete the directory using recursion. The problem is, it's working fine in Win 7, but, in winXP it's not deleting the top-most directory: In Win 7: RemoveDirectory("c:\MyFolder\Folder")--> it's deleting "Folder" including everything inside it. In Win XP: RemoveDirectory("c:\MyFolder\Folder")--> "Folder" is not deleted, but all files and folders inside it are deleted. The program is made in VS 2008 MFC, OS is Win 7. Thanks!

    L 1 Reply Last reply
    0
    • S ShadowUz

      Hello guys. I want to remove directory using RemoveDirectory("directory path"). I delete the directory using recursion. The problem is, it's working fine in Win 7, but, in winXP it's not deleting the top-most directory: In Win 7: RemoveDirectory("c:\MyFolder\Folder")--> it's deleting "Folder" including everything inside it. In Win XP: RemoveDirectory("c:\MyFolder\Folder")--> "Folder" is not deleted, but all files and folders inside it are deleted. The program is made in VS 2008 MFC, OS is Win 7. Thanks!

      L Offline
      L Offline
      Luc 648011
      wrote on last edited by
      #2

      Did you watch the return value of RemoveDirectory? Did you call GetLastError on zero? Might your top-level directory have a different protection? :)

      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