Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Software
Register

Reply
 
LinkBack Thread Tools
Old 11.01.2004, 16:37   #1
Moderator
 
acid's Avatar
 
Join Date: 09 2001
Location: South Korea, Gumi
Posts: 7,699
Downloads: 102
Uploads: 34
Blog Entries: 16
Reputation: 561 | 6
Lightbulb How to delete files with invalid file names

By Abby aka chaxid (Updated 10/03/2003)

How often have you downloaded something off of a peer-2-peer network, or maybe someone uploads something suspicious to your FTP server, and you end up with files that you just can't erase? It's a frustrating thing I have to say, since Windows gives you the most obnoxious error messages:

Error renaming file or folder

Cannot rename file: Cannot read from the source file or disk.

-or maybe-

Error deleting file or folder


Cannot delete file: Cannot read from the source file or disk.

These errors are caused by filenames being created that are not valid or are reserved by Windows. This is much different then a file simply being read-only or perhaps a system file, in which case you could use the "attrib" command to set the file so that it can be deleted.

attrib -s -h -r <filename>

Well you really don't have to put up with it. A Microsoft Knowledge Base Article shows you how you can delete these files quite easily. I'll cite some of the information in that article here, as it is the best solution to this problem. In fact, the entire problem can be addressed by issuing a simple command:

DEL \\.\driveletter:\path\filename
[ for files ]


or

RD \\.\<driveletter>:\<path>\<directory name>
[ for directories ]


If the filename is too long or complicated to disect, always remember that spaces in MS-DOS are denoted by a slash or " / ". That should solve the problem with very long file names that contain spaces. Or you could issue a wildcard statement that would just eliminate all files in the directory. The reason that the above commands work, rather than the standard explorer delete commands, is because they "bypass reverse-word checks". I'm not entirely familiar with reverse-word checks but I'd assume that it is the mechanism that checks for the validity of a filename before the file is manipulated or deleted.

Link: http://www.datiku.com/tutorials/wind..._win_files.htm
Reply With Quote
Old 11.01.2004, 16:56   #2
Грустно...
 
Agregat's Avatar
 
Join Date: 08 2002
Location: Там, где всегда идут дожди
Age: 35
Posts: 21,717
Downloads: 2
Uploads: 0
Reputation: 250 | 7
Default

Использования Юникод имен?
Может не сработать по Окошки 95/98/Ме
Reply With Quote
Old 11.01.2004, 17:06   #3
ЙЦУКЕН
 
Join Date: 07 2002
Location: 0x68,0x69,0x72, 0x69,0x6e,0x67, 0x20,0x6e,0x6f, 0x77
Age: 47
Posts: 3,118
Downloads: 0
Uploads: 0
Reputation: 5 | 0
Default

ндя .... виндовз - эта такая "вещь в себе"
Reply With Quote
Old 11.01.2004, 17:09   #4
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Downloads: 0
Uploads: 0
Reputation: 18 | 5
Default

poleznyj post, vstrechalis' takie "neisstrebimye fayly"..
MS DOS spe**** na pomosh' , nm
Reply With Quote
Old 11.01.2004, 19:44   #5
Moderator
 
acid's Avatar
 
Join Date: 09 2001
Location: South Korea, Gumi
Posts: 7,699
Downloads: 102
Uploads: 34
Blog Entries: 16
Reputation: 561 | 6
Default

Кстати у самого не получилось таким способом. Какой-то файл создал пкунзип, у которого никак не видать имени. И видать это не пробел. Удалить или переименовать ну никак не могу, входить получается. Эни айдиа?
Reply With Quote
Old 12.01.2004, 06:55   #6
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Downloads: 0
Uploads: 0
Reputation: 18 | 5
Default

Quote:
Originally Posted by acid
Кстати у самого не получилось таким способом. Какой-то файл создал пкунзип, у которого никак не видать имени. И видать это не пробел. Удалить или переименовать ну никак не могу, входить получается. Эни айдиа?
Winrar 2.8, Acid..
Reply With Quote
Old 12.01.2004, 15:53   #7
Moderator
 
acid's Avatar
 
Join Date: 09 2001
Location: South Korea, Gumi
Posts: 7,699
Downloads: 102
Uploads: 34
Blog Entries: 16
Reputation: 561 | 6
Default

Quote:
Originally Posted by Greco El
Winrar 2.8, Acid..
Спасибо, твой совет мне очень помог
Reply With Quote
Old 12.01.2004, 22:49   #8
Moderator
 
acid's Avatar
 
Join Date: 09 2001
Location: South Korea, Gumi
Posts: 7,699
Downloads: 102
Uploads: 34
Blog Entries: 16
Reputation: 561 | 6
Default

Получилось ! Для этого нужно было убить explorer.exe, удалить файл у которого не было имени из коммандой строки и опять врубить ехплорер обратно Терд мерни гитутиун.
Reply With Quote
Old 13.01.2004, 08:45   #9
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Downloads: 0
Uploads: 0
Reputation: 18 | 5
Default

н-да, не успел, ну да ладно, может кому пригодится эта инфа
Тут совет, как не "убивать" Explorer, но завершить его культурным образом.

====== ====== ====== ====== ====== ====== ====== ======
1. Open a Command Prompt window and leave it open.

2. Close all open programs.

3. You now need to close EXPLORER.EXE. The proper way to shutdown Explorer is to raise the "Shut Down Windows" dialog (select "Shut Down..." from the start menu), hold down CTRL+SHIFT+ALT and press the CANCEL button. Explorer will exit cleanly.

Note: The <CTRL+ALT+DEL> at the 'Shut Down Windows' dialog method of closing Explorer is built into Explorer. (It was specifically designed so that developers writing Shell Extensions could get Explorer to release their Shell Extension DLLs while debugging them).

4. Go back to the Command Prompt window and change to the directory where the undeletable file is located in. At the command prompt type DEL <filename> where <filename> is the file you wish to delete.

5. Go back to Task Manager, click File, New Task and enter EXPLORER.EXE to restart the GUI shell. /tip by James R. Twine/
====== ====== ====== ====== ====== ====== ====== ======
__________________
И повешенные могут качаться в неположенную сторону. /С.Е.Лец/
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 11:23.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.