Personal computing discussed

Moderators: Flying Fox, Ryu Connor

Grand Gerbil Poohbah
Topic Author
Posts: 3372
Joined: Thu Nov 04, 2004 5:45 pm
Location: Alaska

Delete folders lacking long or short names.

Thu Jun 26, 2014 7:46 pm

There wasn't a single resource on the internet that seemed to address this exact scenario properly, so I figured I'd compile it here for anyone's future reference.

If you find yourself stuck and unable to delete a folder, you'll probably have Googled for suggestions which would suggest you find the short name (or 8.3 name) for the folder. This can work, unless the file somehow does not have a short name associated with it. Here is how I was able to fix this problem by giving the folder a new short name.

1.) Identify the directory you want to delete that does not have a short name. (example: G:\BrokenFolder)
2.) Open a command prompt WITH administrative privileges (right click and open as Administrator)
3.) Change the directory for the command window to the parent directory of the offending folder (example: CD /d G:\)
4.) Type this into the command window
fsutil behavior set disable8dot3 0
press enter
5.) Type the following command with applicable information
 fsutil file setshortname <PathName> <shortname>
(Example: fsutil file setshortname G:\Brokenfolder brok~)
6.) Your folder should now have the short name you set (Example brok~). I was able to just right click the folder and delete it. Alternatively you should be able to see the folders short name in your command window and use the commands to delete the folder.

Deleting a folder with command prompts:

1.) Change your focus to the parent directory the offending folder resides in it you haven't already
CD /d G:\

2.) Type
dir /x
press enter and all directories will display their long and short names
3.) To delete a directory type
rmdir /shortnameofdirectory
and press enter. The short name will generally be listed as a truncated version of the full name and often have a ( ~ ) symbol followed by numbers or other letters. Type the full short name in place of "Shortnameofdirectory" for the code and press enter. This should delete that folder.

If you typed
dir /x
in the correct directory and notice your file does not list with a short or long name still, something went wrong. Re-check your steps and make sure that you typed them exactly correct. Feel free to ask if you run into any issues along the way, notice a typo in my write up or have any questions or have something to add. Hope this helps someone that is stuck!
"I think there is a world market for maybe five computers."
Thomas Watson, chairman of IBM, 1943

i5-2500K|Asus P67 Sabertooth|16GB Corsair 1600|MSI 7850 2GB|500gb 840 EVO|Corsair 400R|ET750w PSU|Corsair M95 / K90 / Vengeance 1300
Hz so good
Gerbil Elite
Posts: 768
Joined: Wed Dec 04, 2013 5:08 pm

Re: Delete folders lacking long or short names.

Thu Jun 26, 2014 11:34 pm

I would've sworn there used be a utility in Sysinternals for that, but I didn't spot it when I skimmed the latest download.

I'm sure there's some tool out there that'll help. Maybe a LiveCD or bootable Thumbstick that let's you access the file system before windows can load.

Wish I coulda been more help!

Who is online

Users browsing this forum: No registered users and 2 guests