删除带有非法字符的文件或文件夹
2006-06-29 15:18
351 查看
今天恢复系统的时候发生了悲剧,原来下载的网页、起过中文文件名的文件夹等等,全都包含了非法字符。对这样的文件,windows explorer无法对其进行任何操作(读写、改名、删除等等)。查找了半天,发现在MSDN中有解决这样问题的答案。不过这个办法只适用于在win98、winMe下,因为它把带有扩展字符集编码的字符,都给解释成了下划线。在win2000以上的版本中有windows resource kit中的一个命令能把文件名中带有非法字符的文件给删除或者改名。不过我却没有找到这个叫rm.exe的程序,microsoft也在自己的网站上去掉了resource kit的下载。
下面是MSDN中的记录
If you want to delete a file, try to delete the file using the DEL command and "*.*" wildcard designator. Note that this method deletes all the files in the folder containing the file you want to delete, so you should move all the files you want to save to a different folder first. To do so, follow these steps:
Type the following commands at an MS-DOS command prompt. Press ENTER after each command:
cd /
md keep
Copy all the files you want to save from the folder containing the file you want to delete to the KEEP folder you created in step 1.
In the directory containing the file you want to delete, type the following command at an MS-DOS command prompt and press ENTER:
del *.*
For files and folders, you may be able to delete or rename the file or folder using the "?" wildcard designator to represent the extended characters in the file or folder name. For example, if the first character in the filename README.TXT were replaced by a character from the extended character set, you could use the following command to rename the file back to README.TXT:
ren ?eadme.txt readme.txt
NOTE: The "?" wildcard designator is used to represent any character in the wildcard designator's position. Use caution when you use this method to make sure you do not inadvertently delete or rename files other than the intended file.
For files or folders, you may be able to delete the file or folder using the DELTREE command. To do so, change to the affected folder and type "deltree *.*" (without quotation marks). Confirm only the files and folders you want to delete. The DELTREE command removes files and folders without regard to extended characters in their names.
Use a disk utility such as Norton Disk Doctor from Symantec or PC Tools from Central Point Software to rename or delete the file.
有一个简便的方法,帮助你整理变乱的文件名。那就是,把机器的既定语言和地域改成英文的,这样绝大多数不能打开的文件就能够进行操作了。如果还是不能,试试改成其他的。
千万不要在你机器上有大量中文文件名的文件的时候,把系统恢复成其他语言的Win98、WinMe。因为他们不支持Unicode!会把你好好的文件名给改得乱七八糟!
下面是MSDN中的记录
RESOLUTION
You may be able to delete or rename the file or folder using one of the following methods:If you want to delete a file, try to delete the file using the DEL command and "*.*" wildcard designator. Note that this method deletes all the files in the folder containing the file you want to delete, so you should move all the files you want to save to a different folder first. To do so, follow these steps:
Type the following commands at an MS-DOS command prompt. Press ENTER after each command:
cd /
md keep
Copy all the files you want to save from the folder containing the file you want to delete to the KEEP folder you created in step 1.
In the directory containing the file you want to delete, type the following command at an MS-DOS command prompt and press ENTER:
del *.*
For files and folders, you may be able to delete or rename the file or folder using the "?" wildcard designator to represent the extended characters in the file or folder name. For example, if the first character in the filename README.TXT were replaced by a character from the extended character set, you could use the following command to rename the file back to README.TXT:
ren ?eadme.txt readme.txt
NOTE: The "?" wildcard designator is used to represent any character in the wildcard designator's position. Use caution when you use this method to make sure you do not inadvertently delete or rename files other than the intended file.
For files or folders, you may be able to delete the file or folder using the DELTREE command. To do so, change to the affected folder and type "deltree *.*" (without quotation marks). Confirm only the files and folders you want to delete. The DELTREE command removes files and folders without regard to extended characters in their names.
Use a disk utility such as Norton Disk Doctor from Symantec or PC Tools from Central Point Software to rename or delete the file.
有一个简便的方法,帮助你整理变乱的文件名。那就是,把机器的既定语言和地域改成英文的,这样绝大多数不能打开的文件就能够进行操作了。如果还是不能,试试改成其他的。
千万不要在你机器上有大量中文文件名的文件的时候,把系统恢复成其他语言的Win98、WinMe。因为他们不支持Unicode!会把你好好的文件名给改得乱七八糟!
相关文章推荐
- 细节问题(删除具有特殊字符的文件/文件夹)
- linux shell 删除指定文件夹下面 名称不包含指定字符的文件
- 基于CentOS7开发之路 --- 日常使用 :Linux 删除带有特殊字符的文件
- mac删除带有多级目录或文件的文件夹命令
- 【Linux】Linux删除指定文件夹下面 名称不包含指定字符的文件
- Java笔记之io——递归创建与删除多层文件夹,字符流实现文件复制
- U盘中出现非法字符命名的文件文件夹的解决办法
- 如何删除文件名是乱码或者带有特殊字符的文件
- Linux 删除带有特殊字符的文件
- linux 删除带有特殊符号的文件及文件夹
- Linux 删除带有特殊字符的文件
- php删除文件夹下所有文件包括非法文件夹
- 删除带有空格字符的文件
- linux删除含特殊字符的文件或文件夹
- Python-递归文件夹并删除文件
- cmd 删除所有文件夹以及子文件夹下的文件
- C# 删除文件和文件夹方法
- 找到某个文件夹 删除此文件夹下30天以前的.c文件
- C#/.NET中删除指定文件夹下所有文件和文件夹的几种方法汇总
- 删除文件夹及文件 bat