Windows Vista Forums

Cannot delete filenames/paths too long!!

  1. #1


    Join Date : Apr 2009
    Posts : 4
    Vista Home Premium
    Local Time: 10:14

    Cannot delete filenames/paths too long!!

    Hi! Please can someone help me? I do not know how this happened, but I have some folders on my pc that have repeatedly copied themselves over and over again, nested one inside the other.. I cannot delete any of them as I get an error that the filenames and file paths are too long..

    I have tried to delete the folder from cmd using rmdir /s but I get the same error message..

    I thought to try to map the folders to a different path using SUBST, but I can't seem to map to any folder (not just the problem ones) When I use SUBST X with the file path, it just creates a virtual drive X but not with any folders in it.. not sure if I am doing something wrong with that..

    I have tried renaming each folder to "1" to make the name as short as possible.. but they are still too long.. also when I get to the last 3 or 4 the possibility to rename is not available either. These folders are packed full of stuff and this is really slowing down the pc..

    i really really need to get rid of them.. any suggestions please?

    Thank you!!!

      My System SpecsSystem Spec

  2. #2


    Guest

    Re: Cannot delete filenames/paths too long!!

    Using \\?\ to prefix filenames

    \\?\c:\path\filename

    bypasses filename length checks in cmd. Lengths of the total path can be
    32k long.

    eg:
    del \\?\c:\path\path\path\path\path\path\path\path\path\path\filename


    "Firecracker" <guest@xxxxxx-email.com> wrote in message
    news:328f8fdbf197d78669764ab1b58be450@xxxxxx-gateway.com...

    >
    > Hi! Please can someone help me? I do not know how this happened, but I
    > have some folders on my pc that have repeatedly copied themselves over
    > and over again, nested one inside the other.. I cannot delete any of
    > them as I get an error that the filenames and file paths are too long..
    >
    > I have tried to delete the folder from cmd using rmdir /s but I get the
    > same error message..
    >
    > I thought to try to map the folders to a different path using SUBST,
    > but I can't seem to map to any folder (not just the problem ones) When I
    > use SUBST X with the file path, it just creates a virtual drive X but
    > not with any folders in it.. not sure if I am doing something wrong with
    > that..
    >
    > I have tried renaming each folder to "1" to make the name as short as
    > possible.. but they are still too long.. also when I get to the last 3
    > or 4 the possibility to rename is not available either. These folders
    > are packed full of stuff and this is really slowing down the pc..
    >
    > i really really need to get rid of them.. any suggestions please?
    >
    > Thank you!!!
    >
    >
    > --
    > Firecracker

      My System SpecsSystem Spec

  3. #3


    Guest

    Re: Cannot delete filenames/paths too long!!

    But I'd run chkdsk. There is a type of disk error that sounds like what you
    have.

    "Firecracker" <guest@xxxxxx-email.com> wrote in message
    news:328f8fdbf197d78669764ab1b58be450@xxxxxx-gateway.com...

    >
    > Hi! Please can someone help me? I do not know how this happened, but I
    > have some folders on my pc that have repeatedly copied themselves over
    > and over again, nested one inside the other.. I cannot delete any of
    > them as I get an error that the filenames and file paths are too long..
    >
    > I have tried to delete the folder from cmd using rmdir /s but I get the
    > same error message..
    >
    > I thought to try to map the folders to a different path using SUBST,
    > but I can't seem to map to any folder (not just the problem ones) When I
    > use SUBST X with the file path, it just creates a virtual drive X but
    > not with any folders in it.. not sure if I am doing something wrong with
    > that..
    >
    > I have tried renaming each folder to "1" to make the name as short as
    > possible.. but they are still too long.. also when I get to the last 3
    > or 4 the possibility to rename is not available either. These folders
    > are packed full of stuff and this is really slowing down the pc..
    >
    > i really really need to get rid of them.. any suggestions please?
    >
    > Thank you!!!
    >
    >
    > --
    > Firecracker

      My System SpecsSystem Spec

  4. #4


    Join Date : Apr 2009
    Posts : 4
    Vista Home Premium
    Local Time: 10:14


      Thread Starter

    Re: Cannot delete filenames/paths too long!!

    Thank you! This is on my home pc, and I am currently at work, but will try out both of these ideas when I get home and let you know how I get on..

      My System SpecsSystem Spec

  5. #5


    Join Date : Apr 2009
    Posts : 4
    Vista Home Premium
    Local Time: 10:14


      Thread Starter

    Re: Cannot delete filenames/paths too long!!

    Hi! I am trying to use the "del \\?\" idea but does that only work for an actual file? The reason I ask is that one of my corrupt folders I have renamed to "1" and it sits in C\Test so I tried "del \\C:\Test\1\ " but that didn't work as it says the filename, directory name, or volume label syntax is incorrect.. I have also tried rmdir /s \\c:\Test\1\ but it didn't like that either..

    Last edited by Firecracker; 16 Apr 2009 at 15:28.
      My System SpecsSystem Spec

  6. #6


    Guest

    Re: Cannot delete filenames/paths too long!!

    You issued the command correctly. \\?\ isn't a fix all but a way to use
    32,000 character long filenames. Programs that want to exceed the normal 260
    character limit, and not be compatable withother window filenames, prefix
    //?/ to the filename.

    See what chkdsk does.
    "Firecracker" <guest@xxxxxx-email.com> wrote in message
    news:4cbefe2c09f32fc204b87b5a5905e433@xxxxxx-gateway.com...

    >
    > Hi! I am trying to use the "del \\?\" idea but does that only work for
    > an actual file? The reason I ask is that one of my corrupt folders I
    > have renamed to "1" and it sits in C\Test so I tried "del \\?\
    > c:\Test\1\" it asked me if I was sure, so I pressed Y but nothing
    > happened...
    >
    > Also, I tried to run chkdsk from cmd but it said I didn't have the
    > privileges so I have scheduled it to run the next time it boots up..
    >
    >
    > --
    > Firecracker

      My System SpecsSystem Spec

  7. #7


    Join Date : Apr 2009
    Posts : 4
    Vista Home Premium
    Local Time: 10:14


      Thread Starter

    Re: Cannot delete filenames/paths too long!!

    Chkdsk didn't reveal anything but I have solved the problem now!!! I was looking around and found this bit of free software for download: DelinvFile version 3.03.. from DelinvFile - Utility for Deleting Invalid Files and Folders i am always v wary of downloading any exe files but this one seemed to be for sale, so i hoped it would be ok and i downloaded it on a 15 day free trial... I just directed it to the folders I wanted to delete and it deleted them by using the DELETE FILE VIA UNC mode. The Delete via Shortname mode failed.. I had to leave it working overnight, i thought it was crashing, but when i woke up the next day the pc had logged itself off and when i logged in again the folders were gone!!!!!! i have 13 days left on the trial so might see if there is anything else corrupt on the pc i need to remove too!

    Thank you for all your help!

      My System SpecsSystem Spec

Cannot delete filenames/paths too long!!

Similar Threads
Thread Forum
Many long hex filenames in C:\Windows folder
I found that I have hundreds of files with names like "bff0053fb87f8a9f5d262b228ebc7909" in my C:\Windows folder that I cannot delete. Does anyone...
General Discussion
convert input file with list of paths+filenames output to list of
I have a text file containing a list of path or folder names and filenames, and I wish to convert it to a list of path or folder name only -- using...
VB Script
Vista long filenames showing
Maybe one of you guys can help out. I use Vista x64 and I browse my explorer windows in the 'List' view. Just recently (well, today actually) my...
General Discussion
Windows 2008 and long paths
Hi! The Vista shell has some support for paths longer than MAX_PATH (260 chars): http://blogs.msdn.com/michkap/archive/2006/12/13/1275292.aspx ...
Server General
Removing long paths
Heya, I run into following problem - while trying to remove folder with long name (stored on networks and needs to be accessed by FQDN), Remove-...
PowerShell
Long paths
Ok, I have an access module which builds an index of directories in the subtree of a user-selected directory/drive. Then, it goes through those...
VB Script
File Paths Too Long
So I was having trouble moving some files around and I ended up with this: ...
Vista file management