Delete files w/long names using DOS

G

Guest

I have XP Home Edition. Virus recently messed everything up. Before getting
fixed want to delete files no longer needed but cannot get to Programs or
Desktop while in safe mode. Can get to C prompt and DOS. I deleted files with
short names but can't delete ones with more than 8 characters. Is there a way
to delete the long-lettered files using DOS? I don't want to delete whole
subdirectories, just particular files in them. Thanks.
 
J

Joe Grover

Type: dir /x

That will give you a column that shows you the 8.3 filename for your files.

For example, address book.txt also shows up as ADDRES~1.TXT. Then you could
delete addres~1.txt

Joe
 
G

Guest

I'll try that. I wonder, though, is it copying the file and I'm deleting the
new file? Or is it renaming it?
 
J

Joe Grover

It's only showing you the file using both long and short filenames. The /x
switch is just a sorting switch. It's the same file.

Joe
 
P

Poprivet

Tafeille said:
I have XP Home Edition. Virus recently messed everything up. Before
getting fixed want to delete files no longer needed but cannot get to
Programs or Desktop while in safe mode. Can get to C prompt and DOS.
I deleted files with short names but can't delete ones with more than
8 characters. Is there a way to delete the long-lettered files using
DOS? I don't want to delete whole subdirectories, just particular
files in them. Thanks.

I assume by DOS you mean the Command Prompt:

Put quotes around the filenames.

e.g. del "x:\my long name \*.dll" or del x:\"my long name"\*.dll are the
same thing.

Or, do a dir and use the exact name as it shows if it has a ~ in it; e.g.
del x:\mylong~1.dll

HTH
Pop`
 
G

Guest

To Joe Grover & Poprivet:

Thank you so much for the help. I tried the suggestions from both of you
and, I'm happy to say, they both worked. Plus, I got two other suggestions
from a friend of mine and they both worked also. So now I have a whole
arsenal of ways to get rid of those files. Thanks again. You two were great.
 

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