To many Directory Levels to delete

G

Guest

Spyware or virus created multiple directory levels. They are so deep that the
length of the string exceeds max. How do I delete the directory. An example
is as follows
/SAM/SAM/SAM/SAM/SAM/SAM/SAM/SAM/...SAM/ "DEL /SAM" does not work.
 
B

Bill Blanton

Recipe Printer said:
Spyware or virus created multiple directory levels. They are so deep that the
length of the string exceeds max. How do I delete the directory. An example
is as follows
/SAM/SAM/SAM/SAM/SAM/SAM/SAM/SAM/...SAM/ "DEL /SAM" does not work.

What is the path's string length to the last dir in the tree?

Assuming you are in the correct dir when issueing the del command, and also
that you are using a \ instead of a / to delimit the dir filespec, you might try
renaming some of the top level dirs to one char names to shorten the
path length.

ren \SAM S
ren \S\SAM\ S
ren \S\S\SAM S
 
P

Patrick Keenan

Jerry said:
You open a DOS box and use deltree sam

Deltree is not an XP command, and if you booted a version of DOS on most XP
systems it won't find the drive as DOS can't normally read NTFS drives
without 3rd party drivers, and the "free" drivers are sometimes read only,
which won't help here.

As noted elsewhere, start with renaming folders to shorter names to shorten
the path, using single letters. You may need to use a command prompt
(start, run, cmd) to do this.

If it isn't at the root of the drive, move it there - that can shorten the
filename significantly.

Also, the "subst" command can be used to shorten the path name enough to
delete the trailing portion. But if there are files there, simply removing
the directory may fail, and you have to navigate further till you find the
file and delete it.

The "dir /s >> list.txt" command will make a text file that you can then
open to find the file. You can *also* use file this to create the next
command, to shorten the path.

for example, "subst x: "c:\documents and settings\your account name "" will
make that path x: which saves a number of characters. Notice the quotes
around "c:\documents and settings\your account name" - you must use quotes
around path names that have spaces. Take the path section from the "dir/s
The "tools, map network drive" option in Explorer may also help with this.

Be sure the virus is no longer running before you do this. Disconnect from
any networks.

And of course, in your example, you're using a forward slash, which is an
invalid character for XP filenames.

HTH
-pk
 
V

Val

rd or rmdir with the /s flag will do the job of deltree.


Jerry said:
You open a DOS box and use deltree sam

Deltree is not an XP command, and if you booted a version of DOS on most XP
systems it won't find the drive as DOS can't normally read NTFS drives
without 3rd party drivers, and the "free" drivers are sometimes read only,
which won't help here.

<<snip>>
 
G

Guest

When ever I do anything to shorten the string length, something grows more
directories.
JWN
 
J

John

When ever I do anything to shorten the string length, something grows more
directories.


I think you need to create and boot a Linux Live CD, like Knoppix, or
Damn Small Linux.

A better solution is to check out BartPE. Google will get you there.
It boots a CD, with an XP environment, so you can boot from it, and
just delete the offending directory. Its a valuable tool, once you see
all that you can do with it by adding programs, and modifying it to
suit your needs.

HTH,

John
 
P

Patrick Keenan

Recipe Printer said:
When ever I do anything to shorten the string length, something grows more
directories.
JWN

Then the virus is still active, and you need to stop it.

HTH
-pk
 

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