Re: Cannot delete files

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: R. C. White (RCWhite_at_msn.com)
Date: 02/05/04


Date: Thu, 5 Feb 2004 16:34:11 -0600

Hi, Steel.

There HAS to be an 8.3 filename! (I think. I'm an accountant, not a techie
or CS expert, but I've spent years prowling around in HD directories, a byte
at a time. Of course, that was in FAT; I never learned much about NTFS.)

SFN is a slight misnomer in that even a 3-letter filename can be illegal if
it contains an illegal character, even a space. In such case, the system
will automatically generate a legal filename that does not include the
illegal character. Dir /x will show those legal filenames in a column
before the LFNs. For instance, when you ask for Dir /x in the Root of a
WinXP volume, you should get a listing that includes the folder "Program
Files". In a column between the file size and "Program Files", you should
see "PROGRA~1". If you then type "rd progra~1", it will tell you Access
Denied. But, if you add the /s switch, it will ask, "Are you sure (Y/N)?"
I've not been brave enough to tell it Yes on THIS folder, but on just about
any other, it will wipe out the whole tree.

Your first post said:
>contain illeagal characters for example "W
>NOD.EE"

When I use Ctrl+F3 to see the actual content of your post, that quote
translates to:
"W
>N=17O=12D.E=18E"

In Windows Explorer, I created a New folder named "N?O?D.E?E". (The
characters don't look quite the same in this email font; I used the Alt key
+ the Num pad keys to create them.) Then I went to the "DOS" window and
typed Dir /x. The LFN on that line looked weird (a still different set of
characters), but the SFN was "NOD~1.EE". When I typed rd N?O?D.E?E, using
the Alt+key combos, I got the same error message you did ("...syntax is
incorrect"). But when I typed rd nod~1.ee, that folder was erased and did
not appear in the next Dir.

Try the Dir /x command again, looking for the SFN column between the file
size and the LFN. Many of the SFNs will probably include the ~ character,
and they will probably be in ALL CAPS. Use those SFNs with the Del command
to delete a file or RD <SFN> to delete a folder.

RC

-- 
R. C. White, CPA
San Marcos, TX
rc@corridor.net
Microsoft Windows MVP
<anonymous@discussions.microsoft.com> wrote in message
news:b05701c3ec24$d818af20$a001280a@phx.gbl...
sorry mate this doesn't appear to work
it seems there r no SFN to any of the files
and when i try to delete the whole directory using its
SFN it returns "the filename, directory name, or volume
label syntax is incorrect
>-----Original Message-----
>Hi, Steel.
>
>In the "DOS" window, use the Dir command with /x, the
switch that reveals
>the SFN (Short File Name, also known as the 8.3
filename).  Then use del
><SFN> to delete individual files, or rd <SFN> /s to
remove the entire
>directory tree, including all files and folders.
Deltree is not available
>in WinXP, but the /s switch with rd does just about the
same thing.
>
>As usual in a "DOS" window, type any command followed
by /? to see a
>mini-help file listing all the switches available with
that command.  For
>example:  Dir /?
>
>RC
>
>"Steel" <thesteelman@blueyonder.co.uk> wrote in message
>news:a97901c3ebcb$ea27a120$a401280a@phx.gbl...
>I have two folders on my system which contain files, when
>i try to delete them xp return with "Cannot delete
>file:Cannot read from source file or disk". These files
>contain illeagal characters for example "W
>NOD.EE",also when ever i use a virus scan the
>scan freezes and goes over and over the same file, I've
>tried to delete these files from MSDOS prompt with del
>deltree rm, but to no avial. even tried copying them to
>another drive....doesn't work
>Please help
>Steel


Relevant Pages

  • Re: Unable to delete folder
    ... > the Long File Names should be a column showing the SFN (Short File Name, ... > also known as the 8.3 filename) for each file whose LFN does not qualify as ... > MS Word, then Save it, Word will normally add its own .doc extension, making ... Either Move it into another folder or Move everything except this ...
    (microsoft.public.windows.file_system)
  • Re: File with invalid name
    ... It simply won't create a folder with a filename that includes a wildcard, ... Before the Long File Names, you should see a column showing the SFN ... considered LFNs if they include an illegal character, ...
    (microsoft.public.win2000.file_system)
  • Re: Error Message: "The File Name is Not Valid or Too Long...."
    ... I, then, proceed to name that file using only valid characters. ... the destination folder. ... That is not counting the drive letter and slashes or the filename itself. ... (Again - not counting the extension/dot.) ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Word changes and adds characters to file name on opening document
    ... Shorten the folder names in the filepath and rename the document to the ... Manually enter the filename into the header, ... I don't know if spaces are recorded as single characters or as ...
    (microsoft.public.mac.office.word)
  • RE: open workbook using wildcard
    ... You could also prompt the user for the filename using ... Dim FName As String ... Dim Folder As Object ... The first 4 characters remain constant. ...
    (microsoft.public.excel.programming)