Delete folders lacking long or short names.

Monopoly money comes in many flavors: 7, Vista, XP, 2K, ME, 98, etc.

Moderators: Flying Fox, Ryu Connor

Delete folders lacking long or short names.

Postposted on 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
Code: Select all
fsutil behavior set disable8dot3 0
press enter
5.) Type the following command with applicable information
Code: Select all
 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
Code: Select all
CD /d G:\

2.) Type
Code: Select all
dir /x
press enter and all directories will display their long and short names
3.) To delete a directory type
Code: Select all
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
Code: Select all
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|250gb Evo 840|Corsair 400R|ET750w PSU|Logitech G5|Dell 2420L|Corsair Vengeance 1300
Welch
Minister of Gerbil Affairs
Gold subscriber
 
 
Posts: 2675
Joined: Thu Nov 04, 2004 5:45 pm
Location: Fairbanks, Alaska

Re: Delete folders lacking long or short names.

Postposted on 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!
Hz so good
Gerbil Elite
 
Posts: 733
Joined: Wed Dec 04, 2013 5:08 pm


Return to Windows

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 1 guest