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. The Lounge
  3. Help me to delete a Directory

Help me to delete a Directory

Scheduled Pinned Locked Moved The Lounge
helpcomquestion
26 Posts 13 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.
  • D Daniel Turini

    on a DOS prompt, try (suppose the folder name is "Folder ":

    ren Fol* SomeNiceName

    And then delete SomeNiceName. Yes, even I am blogging now!

    N Offline
    N Offline
    Neville Franks
    wrote on last edited by
    #17

    I had already tried that, didn't work either. See my reply to PJ's thread. Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"

    1 Reply Last reply
    0
    • N Neville Franks

      Ok I've accidently created a directory on WinXP which has a SPACE as the last character and I can't delete it from Explorer, DOS or in code. I also can't rename it from Explorer. I figured ChkDsk would fix it up but it doesn't find any problems. What to do? And why the heck did Windows let me create it in the first place.:confused: Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"

      B Offline
      B Offline
      Bassam Abdul Baki
      wrote on last edited by
      #18

      Back in the days of Kazaa, I decided one day to uninstall it. It accidentally left a folder in there (can't remember the name) that I couldn't delete. I tried just about every way that I can think of, and even up to today (2 years later - and no I don't usually format such problems away :)), that darn folder still exists. What's funny is that I can't even open the folder in Windows Explorer or use a DOS window to peek into its contents. As far as I can see, it has no special attributes, but it won't allow me to manipulate even those in Windows and in DOS. Here's an idea for a necessary tool for someone to create. Read the content of a file or folder, determine where in assembly that file/folder is. Go down to the byte-code of that file/folder and zero it (fragment it) out completely. "For that one fraction of a second, you were open to options you would never have considered. That is the exploration that awaits you. Not mapping stars and studying nebula, but charting the unknown possibilities of existence." - Q (Star Trek: The Next Generation) ^ Blog

      B 1 Reply Last reply
      0
      • N Neville Franks

        Ok I've accidently created a directory on WinXP which has a SPACE as the last character and I can't delete it from Explorer, DOS or in code. I also can't rename it from Explorer. I figured ChkDsk would fix it up but it doesn't find any problems. What to do? And why the heck did Windows let me create it in the first place.:confused: Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"

        O Offline
        O Offline
        Obliterator
        wrote on last edited by
        #19

        Yeah its a really annoying problem I've encountered before. One of my FTP clients downloaded a file from a unix machine, the name of which ended in a space. Spaces are legal in the filesystem, but illegal in windows. It seems the APIs allow such creation, but windows and is then unable to deal with them. KB Q101754: Unable to Delete File or Directory in File Manager[^] KB Q120716: How to Remove Files with Reserved Names in Windows[^] -- The Obliterator

        N 1 Reply Last reply
        0
        • N Neville Franks

          Ok I've accidently created a directory on WinXP which has a SPACE as the last character and I can't delete it from Explorer, DOS or in code. I also can't rename it from Explorer. I figured ChkDsk would fix it up but it doesn't find any problems. What to do? And why the heck did Windows let me create it in the first place.:confused: Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"

          K Offline
          K Offline
          KaRl
          wrote on last edited by
          #20

          Find the DOS short name for your folder (the one with a "~") and try to delete using this short name, 8+3. You could use Windows API GetShortPathName to find it, but I'm sure there'a an easy way through the command line. I just don't remember which one :~


          Fold With Us! Sie wollen mein Herz am rechten Fleck, doch Seh' ich dann nach unten weg Da schlägt es links

          M 1 Reply Last reply
          0
          • N Neville Franks

            Ok I've accidently created a directory on WinXP which has a SPACE as the last character and I can't delete it from Explorer, DOS or in code. I also can't rename it from Explorer. I figured ChkDsk would fix it up but it doesn't find any problems. What to do? And why the heck did Windows let me create it in the first place.:confused: Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"

            M Offline
            M Offline
            Michael Dunn
            wrote on last edited by
            #21

            I'm too lazy to read thru the thread ;) to see if anyone's suggested this yet, but you can prepend \\?\ to any path to turn off special character parsing, so this might work: del "\\?\C:\path\to\dir " If that doesn't work on the command line, I 99% guarantee it would work in C code. --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb Strange things are afoot at the U+004B U+20DD

            1 Reply Last reply
            0
            • K KaRl

              Find the DOS short name for your folder (the one with a "~") and try to delete using this short name, 8+3. You could use Windows API GetShortPathName to find it, but I'm sure there'a an easy way through the command line. I just don't remember which one :~


              Fold With Us! Sie wollen mein Herz am rechten Fleck, doch Seh' ich dann nach unten weg Da schlägt es links

              M Offline
              M Offline
              Michael Dunn
              wrote on last edited by
              #22

              dir /x shows you the 8.3 aliases. --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb Strange things are afoot at the U+004B U+20DD

              K N 2 Replies Last reply
              0
              • M Michael Dunn

                dir /x shows you the 8.3 aliases. --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb Strange things are afoot at the U+004B U+20DD

                K Offline
                K Offline
                KaRl
                wrote on last edited by
                #23

                How could I forget that :doh: Thanks!


                Fold With Us! Sie wollen mein Herz am rechten Fleck, doch Seh' ich dann nach unten weg Da schlägt es links

                1 Reply Last reply
                0
                • O Obliterator

                  Yeah its a really annoying problem I've encountered before. One of my FTP clients downloaded a file from a unix machine, the name of which ended in a space. Spaces are legal in the filesystem, but illegal in windows. It seems the APIs allow such creation, but windows and is then unable to deal with them. KB Q101754: Unable to Delete File or Directory in File Manager[^] KB Q120716: How to Remove Files with Reserved Names in Windows[^] -- The Obliterator

                  N Offline
                  N Offline
                  Neville Franks
                  wrote on last edited by
                  #24

                  Excellent, where were you earlier.:) I'd already stumbled upon dir /x and rmdir 8.3 name which worked nicely. I'll put your links+info in Surfulater.:) Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"

                  1 Reply Last reply
                  0
                  • M Michael Dunn

                    dir /x shows you the 8.3 aliases. --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb Strange things are afoot at the U+004B U+20DD

                    N Offline
                    N Offline
                    Neville Franks
                    wrote on last edited by
                    #25

                    Thanks. I'd already stumbled upon dir /x and rmdir 8.3 name which worked nicely. The issue was worse because the file was: "http " and I assume http is a reserved system name. Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"

                    1 Reply Last reply
                    0
                    • B Bassam Abdul Baki

                      Back in the days of Kazaa, I decided one day to uninstall it. It accidentally left a folder in there (can't remember the name) that I couldn't delete. I tried just about every way that I can think of, and even up to today (2 years later - and no I don't usually format such problems away :)), that darn folder still exists. What's funny is that I can't even open the folder in Windows Explorer or use a DOS window to peek into its contents. As far as I can see, it has no special attributes, but it won't allow me to manipulate even those in Windows and in DOS. Here's an idea for a necessary tool for someone to create. Read the content of a file or folder, determine where in assembly that file/folder is. Go down to the byte-code of that file/folder and zero it (fragment it) out completely. "For that one fraction of a second, you were open to options you would never have considered. That is the exploration that awaits you. Not mapping stars and studying nebula, but charting the unknown possibilities of existence." - Q (Star Trek: The Next Generation) ^ Blog

                      B Offline
                      B Offline
                      Bassam Abdul Baki
                      wrote on last edited by
                      #26

                      Aplogies to Kazaa, it was Morpheus. "For that one fraction of a second, you were open to options you would never have considered. That is the exploration that awaits you. Not mapping stars and studying nebula, but charting the unknown possibilities of existence." - Q (Star Trek: The Next Generation) ^ Blog

                      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