Filename contains quote mark: can't delete or rename

G

Guest

I am trying to uninstall a product from a Win2k box. A large number of files
have 8.3 filenames that contain quotation marks ( LA"D3F~1.HTM ).

The full path of one such file is C:\Program Files\Jasc Software Inc\Paint
Shop Pro 8\Learning Center\Command_API\Non-menu_commands\LA"D3F~1.HTM

I can't delete these files using Explorer or command line, specifying the
file with either regular or UNC path or with wildcards.

I've also tried doing this using the Win32 API DeleteFile and DeleteFileW
functions, passing the filename reported by FindNextFile.

I've also tried unsuccessfully to remove the parent directory.

In all instances I get the same error: "The filename, directory name, or
volume label syntax is incorrect."

I also have a few dozen files in my recycle bin that have quotation marks in
their names, and I get the same error message when I try to empty my recycle
bin.

Chkdsk (scheduled for boot time with chkhtfs) doesn't report any errors or
fix the problem.

Can anyone help me figure out how to either delete these files?
 
A

Adam Piggott

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I am trying to uninstall a product from a Win2k box. A large number of files
have 8.3 filenames that contain quotation marks ( LA"D3F~1.HTM ).

This might be of help:
You cannot delete a file or a folder on an NTFS file system volume
http://support.microsoft.com/kb/320081/en-us


Otherwise there may be other helpful articles at:
http://support.microsoft.com/search...&mdt=&pwt=False&res=20&2057comm=1&range=21-40

Let us know how you get on!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)

iD8DBQFFaIB37uRVdtPsXDkRAje0AJ0bjv7xoEwxgjWbkCZBKAHQS5bkugCfewe3
AbXbSzrgfb85e8itR9BgA9w=
=jlmc
-----END PGP SIGNATURE-----
 
R

R. C. White, MVP

Hi, Orfeo.

Have you tried the good ol' dir /x trick?

Open a Command Prompt window. Navigate to the folder that holds that file
in your example. At the command prompt, type: dir /x

This should produce the usual list of all files in that folder, but with an
extra column before the Long File Names (LFN) showing the Short File Names
(SFN), also known as the 8.3 filenames. Then use the del command with that
SFN.

Doesn't always work, but usually does. Worth a try.

RC
--
R. C. White, CPA
San Marcos, TX
(e-mail address removed)
Microsoft Windows MVP
(Currently running Vista x64)
 
G

Guest

Thanks for the suggestion, RC.

The problem is that the short file name has an illegal character (quote
mark): LA"DF~1.HTM

I don't know how a file got created that has an illegal 8.3 short file name,
but now I don't seem to be able to do anything from explorer, the command
prompt, or Win32 API function calls that can delete it or change anything
about this file.

Wildcards (del *.*) don't do any good. Trying to remove the parent directory
(deleting it from explorer or doing rd /s from the command line) doesn't work.

Everything I try to do ends up with an error of the form "The filename,
directory name, or volume label syntax is incorrect."

I suspect that to get anywhere with this problem, I'm going to need to call
some low-level API, but I don't have a clue where to look.
 
K

KeithMail

If this helps.. We had a Windows 2000 based net server attacked and a series
of restricted name files and folders (like lpt and com) were created by the
hackers, there was a KB article which we used which described using Windows
posix? subsystem commands to remove the files. Similar to that described in
the 320081 recommended by Adam but using the win2000 resource kit file
RM.exe

It worked but we had to use peculiar file path entries.. does that make any
sense or trigger a bell with anyone else to find more information with?
There's a reference to something similar on www.pkidd.com/win_faq.htm and
search for posix
I draw the comparison because of the failure we had using the "normal"
windows file commands to remove the garbage.
Does using a single ? char in place of the quote symbol in the file name
help?
Does Ztree (ztree.com) do it, our regular techy swears by it.

Keith
 
J

James

KeithMail said:
If this helps.. We had a Windows 2000 based net server attacked and a series
of restricted name files and folders (like lpt and com) were created by the
hackers, there was a KB article which we used which described using Windows
posix? subsystem commands to remove the files. Similar to that described in
the 320081 recommended by Adam but using the win2000 resource kit file
RM.exe

It worked but we had to use peculiar file path entries.. does that make any
sense or trigger a bell with anyone else to find more information with?
There's a reference to something similar on www.pkidd.com/win_faq.htm and
search for posix
I draw the comparison because of the failure we had using the "normal"
windows file commands to remove the garbage.
Does using a single ? char in place of the quote symbol in the file name
help?
Does Ztree (ztree.com) do it, our regular techy swears by it.

Keith
If there is anyone out there that knows the directory layout used in M$
perhaps they can jump in with the method to use at the hex mode of the
system. I knew the formats of older directories and routinely fixed
problem entries at that level but it requires in depth knowledge of how
the directory entries are handled.

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top