August 18, 2004

Deleting locked files or folders

This isn't really a "programming" tip, but it's a little tidbit I'm glad to have found, having been plagued in the past with Files That Would Not Die. Corey Collins explains How to Remove "locked" Folders/Files on his blog:

First, open a command window and go to the directory where the illegal files and folders are. Type in dir /x. This will list the files with a truncated 8 character dos name. The files will now have a ~1 after them, they will only have legal characters in them, and only be 8 characters long. Now, type rmdir /s baddir~1. This will delete the directory and everything inside of it. This can be a little time consuming if there are a lot of files, but it works.
Technorati tags:

src="http://feeds.feedburner.com/~s/ChaosMagnet?i=http://www.chaosmagnet.com/blog/archives/000471.html" type="text/javascript" charset="utf-8">
Posted by roadnick at August 18, 2004 11:16 PM | TrackBack

Comments

Nice, but how to delete a single file in a folder and keep the other files of this folder intact?

Posted by: Ben at February 13, 2006 10:59 AM
Post a comment









Remember personal info?