Re: File Attributes a real stumper
- From: "Ace Fekay [Microsoft Certified Trainer]" <aceman@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 20 Jun 2009 20:03:36 -0400
"James Robertson" <JamesRobertson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:ED1B1295-5684-4DA1-A7C4-9DFAAD522724@xxxxxxxxxxxxxxxx
Here is the issue. I have a file that is a pain in the filesystem. It is a
Hidden System file that does not belong there. A user downloaded the file
and it has been there ever since. You cannot change the attributes with
attrib as it stated that the file is not found. I have run chsdsk and it is
still there. Can someone assist me in how to get rid of this blemish?
Thanks alot.
James,
Apparently the file may have illegal ASCII characters in it that Windows doesn't recognize. Windows is based on that ANSI character set, or it may contain reserved windows names, such as 'com', 'lpt', or others. I've seen these type of files created using FTP, which supports ASCII, and an FTP server supports ASCII, and Windows will create it from FTP, but when you try to view it, or delete it, you'll have problems. Same if it was downloaded through HTTP.
If you know where the file is, and you know part of the name, you may be able to delete it. You can follow Meinolf's suggestions, or you may want to read my blog on these type of files and what your options are with deleting them.
Let me know if this helped.
======================================================================================================
To delete those undeletable files and folders:
A little background on undeletable files and folders:
I've seen these in the past regarding 'pubbed' FTP servers by software, game and movie users that find open FTP servers. They would upload their illegal software to the FTP servers they find, but they would name the files and the folder they create with extended characters and symbols that FTP supports but Windows does not directly support (ASCII characters), as well as create a very deep file structure with these extended unsupported ASCII characters, and/or file names with these characters that are greater than 256 characters. Windows directly supports ANSI characters. However, although Windows supports ASCII characters indirectly, it is not supported directly through the Windows Explorer GUI or the command line. Therefore this prevents admins from getting to them or deleting them, nor delete them. In the older NT4 days, you could install the POSIX support tools (to support UNIX based commands and using ASCII characters) to read and remove them, but that no longer applies with Windows 2000 and newer. However Windows still provides POSIX support but not directly. They can be deleted by using specific commands, but you just have to know the commands!
Also, if it was an FTP created folder and files, and the size shows zero bytes, yet you know it is much larger, then it's also likely the files are using an alternate data stream which would explain why their file size appears as zero bytes.
So the other factor, as mentioned, is if the file, folder name, and/or number of child folders is greater than 256 characters. Many operating system limits are based on the i386 addressable 32bit architecture, such as the number of useres that can access a share, which is 4.3 billion objects. It also depends on the drive and if an app can read it. Many programs also expect a limit of 256 objects (characters, paths, bytes, etc), maybe even the deltree command is limited, however NTFS formatted drives can go beyond the 256 objects.
Is the drive NTFS?
Therefore, not being able to delete them is caused by the factors above, special or extended ASCII characters, trailing spaces, trailing dots (periods) or reserved names in the folders, such as com, lpt, etc, such as when a machine gets 'pubbed' into an FTP site where the 'pubsters' will create these deep paths and using reserved names to prevent the admin from deleting them. If you've found someone accidentally created such files or subfolders with these characters, it will give you headaches to remove them. With an FTP app it's easy to read and remove them, because FTP uses ASCII characters, such as what POSIX uses, however WIndows uses ANSI and cannot translate the folders. IN this case, you can setup a local FTP service, then use an FTP app to connect to your own machine, then you wil be able to read and delete the files and folders. That is only one option, which many adminstrators are reluctant to do.
Try the following:
Removing folder examples:
Assuming the first folder is the numeral "1" on D drive (and use the quotes if you have problems and watch the required periods if the command uses it):
rm -r "//D/1"
RD \\.\c=D:\1
RmDir \\.\D:\1 /s /q
RmDir \\.\C:\YourFTP_ROOT's_PATH\COM1 /s /q
C:\>cd inetpub\ftproot
C:\Inetpub\ftproot>rd /s /q \\?\c:\inetpub\ftproot
NOTE - The syntax is literal, do not substitue or remove the question mark (?), change only the path.
Removing files examples:
Note: In the following examples, if the filename contains symbollic, extended or other characters, enter what you can and wildcard the rest or use file completion or use a full wildcard.
DEL \\.\c:\somedir\filename.
DEL \\.\c:\somedir\lpt
DEL \\.\c:\somedir\aux
DEL \\.\c:\somedir\com
etc
Read the following references for more information and specific instructions if the above doesn't work for you.
How to Remove Files with Reserved Names in Windows:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q120716
You cannot delete a file or a folder on an NTFS file system volume:
http://support.microsoft.com/kb/320081
Cannot Delete Files or Folders with Extended Characters:
http://support.microsoft.com/kb/131702
Here's how to create a locked folder with FTP:
http://www.madchat.org/coding/w32nt.rev/dirnt.htm
Here's how to delete them:
How to Remove Files with Reserved Names in Windows
http://support.microsoft.com/kb/120716
======================================================================================================
--
Ace
This posting is provided "AS-IS" with no warranties or guarantees and confers no rights.
Please reply back to the newsgroup/forum to benefit from collaboration among responding engineers, as well as to help others benefit from your resolution.
Ace Fekay, MCSE 2003 & 2000, MCSA 2003 & 2000, MCSA Messaging, MCT
Microsoft Certified Trainer
aceman@xxxxxxxxxxxxxxxxxxxxxxx
http://twitter.com/acefekay
For urgent issues, you may want to contact Microsoft PSS directly. Please check http://support.microsoft.com for regional support phone numbers.
.
- References:
- File Attributes a real stumper
- From: James Robertson
- File Attributes a real stumper
- Prev by Date: Re: File Attributes a real stumper
- Next by Date: Re: For files command problem
- Previous by thread: Re: File Attributes a real stumper
- Next by thread: RE: File Attributes a real stumper
- Index(es):
Relevant Pages
|
Loading