Try with quotes to delete these files.
Like "filename.ext " ?
Main Topics
Browse All TopicsI run an ftp, and lately have run into a strange problem. Someone has uploaded folders that I cannot delete. These folders have a space at the end of the the name, so I cannot delete, rename, move, or do anything to them.
Anyone know any tricks to get rid of this problem? (without formatting)
Thanks!
-Luke
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Some more to try:
if you have fat file system try this:
say your directory name is this: directory (space)
then type in this in a command prompt:
rmdir directory?
this will remove ALL directories that are named directory(then something else).
I just created a test folder on my c:\ and used the rmdir command to delete it with no switches or parameters at all...worked for me...what exactly IS the file name?
For NT.2k/XP
JSI tip 2057 I went to the command line, switched to the directory and typed -- RD /S
"" This removed the offending directories and files (with names nt doesn't like) per and in similar
fashion to, what Tim Holman offered above which would probably have the same result.
http://www.jsiinc.com/tip2
I hope this helps !
Ok I think what has happened is that the hacker has added a character to the end of the folder that Explorer does not recognize.
Try this open a command window and do this
If NT Win2000 or XP Open a CMD.EXE window. If Win9x-ME open COMMAND.COM.
CD to the top of the mess.
Use: DIR /X /A to see the SHORT FILE NAMES of the files and directories there.
Use a combination of CD, RD, and DEL and the SHORT FILES names reported with DIR /X to delete your
way to the bottom and then back up the tree removing the files on the way down and the directories on
the way up.
Most likely there is NOT a protection issue here so you shouldn't need worry about ownership or file
protections.
RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path
/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.
/Q Quiet mode, do not ask if ok to remove a directory tree with /S
This MS KB article may help
BEGIN ARTICLE
How to Remove Files with Reserved Names in Windows (Q120716)
--------------------------
The information in this article applies to:
Microsoft Windows 2000 , Professional
Microsoft Windows 2000 , Server
Microsoft Windows 2000 , Advanced Server
Microsoft Windows 2000 , Datacenter Server
Microsoft Windows NT Server versions 3.1 , 3.5 , 3.51 , 4.0
Microsoft Windows NT Workstation versions 3.1 , 3.5 , 3.51 , 4.0
Microsoft Windows NT Advanced Server
--------------------------
SUMMARY
Because applications control the policy for creating files in Windows, files sometimes are created with illegal or reserved names, such as LPT1 or PRN. This article explains how to delete such files using the standard user interface.
MORE INFORMATION
NOTE : You must be logged on locally to the Windows computer to delete these files.
If the file was created on a file allocation table (FAT) partition, you may be able to delete it under MS-DOS using standard command line utilities (such as DEL) with wildcards. For example:
DEL PR?.*
-or-
DEL LPT?.*
These commands do not work on an NTFS partition as NTFS supports the POSIX subsystem and filenames such as PRN are legal under this subsystem. However, the operating system assumes the application that created them can also delete them; therefore, you can use commands native to the POSIX subsystem.
You can delete (unlink) these files using a simple, native POSIX application. For example, the Windows Resource Kit includes such a tool, Rm.exe.
NOTE : POSIX commands are case sensitive. Drives and folders are referenced differently than in MS-DOS. Windows 2000 and later POSIX commands must use the following usage syntax:
posix /c <path\command> [<args>] IE: posix /c c:\rm.exe -d AUX.
Usage assumes Rm.exe is either in the path, or the current folder:
rm -d // driveletter / path using forward slashes / filename
For example, to remove a file or folder named COM1 (located at C:\Program Files\Subdir in this example), type the following command:
rm -d "//C/Program Files/Subdir/COM1"
To remove a folder and its entire contents (C:\Program Files\BadFolder in this example), type the following command:
rm -r "//C/Program Files/BadFolder"
Another option is to use a syntax that bypasses the normal reserve-word checks altogether. For example, you can possibly delete any file with a command such as:
DEL \\.\ driveletter :\ path \ filename
For example:
DEL \\.\c:\somedir\aux
--------------------------
Published Jun 3 1997 7:28AM Issue Type
Last Modifed Dec 22 2001 12:57PM Additional Query Words 3.10 prodnt CON PRN AUX CLOCK$ NUL COM1 LPT1 LPT2 LPT3 COM2 COM3 COM4 winnt
Keywords kbusage
COPYRIGHT NOTICE. Copyright 2002 Microsoft Corporation, One Microsoft Way, Redmond, Washington 98052-6399 U.S.A. All rights reserved.
END ARTICLE
The Crazy One
I created special charactor folders using telnet on a win2k system yesterday and had no problems whatsoever deleting them from Win2k, no special switches or anything like that...also, created a folder named test(hit space bar at end of name-then enter to apply the named space(space bar))had no problems deleting that either using the cmd prompt....so it must be win98
Sorry about the shortage of information:
The OS is Microsoft Windows 2k Server
Since the file system is ntfs, any DOS tricks are out of the question. I realize I can use a utility like system commander to convert the file system to fat32, but Im hoping there is an alternative solution.
Unfortunatly I am late for work right now, so I can try any of the ideas given above yet. Will let you know if anything works later in the day.
thanks,
So, this is really starting to bug me:
do this:
get yourself a linux boot floppy, you MUST know someone running linux...
then, use it to boot your PC
then mount the ntfs partition like this:
mount -t ntfs /dev/hdaX /mnt
(where X is the number of your drive, primary master in windows is hda0 and every drive is incremented by 1, so hda2,hda3,hda4 etc.etc,etc
OH YEAH, once you get onto the NTFS mount using the linux boot disk, cd to the directory where the file resides and type this at $ rmdir -rf <filename>
rm is remove -r = recursively(deletes all files and directories below specified dir to delete)
-f is to force the removal of the directory no matter what...
Cheers.
BTW---we still don't know the file name, take a screen shot and upload it to the web if you have to, we'd like to see it...
Well, unfortunatly the problem was worse than I thought. Instead of it just being an undeletable folder, it turned into tens of thousands of undeletable folders. There must have been a virus somewhere that kept creating new folders in the old ones.
I tried all of the ideas listed here (actually, I didn't get around to using a linux disk to mount the drive), and nothing worked. Using short file names didnt even work. At this point my server drive was out of free space, and I had to solve the problem fast. I ended up having to use system commander to convert the file system to FAT32, and then delete the folders that way.
Sorry I didn't have the time to let you guys come up with some more ideas, but the server had already been down 2 days, and that is 2 days too many.
** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER **
It appears that this question has been abandoned. Please take a moment to finalize the question & reward your points as appropriate. If this question is not finalized within 7 days, Community Support will be requested to force close it. Unless there is objection or further activity, it will also be requested that points be awarded to the following expert(s) for their comments:
N/A; situation resolved by asker
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post a request in Community support (with a link to this page) to refund your points. The link to the Community Support area is: http://www.experts-exchang
/EW
** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER **
just an fyi, i had a similar problem and CrazyOne's solution worked perfectly without much effort...i think he/she should be getting these points
i also posted crazyone's response to:
http://www.tek-tips.com/vi
yeh it worked
Business Accounts
Answer for Membership
by: WakeupPosted on 2002-05-20 at 22:59:01ID: 7023282
What OS? are you trying to delete them from a GUI interface or a Dos interface? or through the FTP?
What happens when you try and delete it? get any error messages?
My suggestion is if you have a GUI interface, just drag it to the recycle bin....or highlight it and hit Delete.
Or, you can right mouse click on it and choose delete.
what happens when you try either of these routes?
Give us a little more info so we can help ya out.