删除Windows文件名过长的文件或者目录
2010-06-01 17:32
633 查看
有时候下载一个压缩文件,解压缩后却无法删除这个解压缩的文件夹,
原因是文件名称过长。我就碰到过,例如在eclipse的一些版本的IDE,由于
java的命名的特性,文件名称过长,既无法重命名,无法复制,也无法删除。
具体有两种解决办法:
A. 进入windows命令行,到达文件所在目录,通过如下命令删除文件或者目录。
DIR /X
RMDIR /S 文件名或者目录
顺便学习下WINDOWS的基本命令行
----------------------------------------------------------------------------------------------------------------------------------------------------
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L]
[/N] [/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]
RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path
B. 建立一个del.bat 文件,其内容如下:
"DEL /F /A /Q //?/%1
RD /S /Q //?/%1"
------------------------------------------------------------------------------------------------------------------------------------------------------------
DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
ERASE [/P] [/F]
[/S] [/Q] [/A[[:]attributes]] names
原因是文件名称过长。我就碰到过,例如在eclipse的一些版本的IDE,由于
java的命名的特性,文件名称过长,既无法重命名,无法复制,也无法删除。
具体有两种解决办法:
A. 进入windows命令行,到达文件所在目录,通过如下命令删除文件或者目录。
DIR /X
RMDIR /S 文件名或者目录
顺便学习下WINDOWS的基本命令行
----------------------------------------------------------------------------------------------------------------------------------------------------
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L]
[/N] [/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]
[drive:][path][filename] | Specifies drive, directory, and/or files to list. |
attributes | D Directories R Read-only files H Hidden files A Files ready for archiving S System files - Prefix meaning not |
/B | Uses bare format (no heading information or summary). |
/C | Display the thousand separator in file sizes. This is the default. Use /-C to disable display of separator. |
/D | Same as wide but files are list sorted by column. |
/L | Uses lowercase. |
/N | New long list format where filenames are on the far right. |
/O | List by files in sorted order. |
sortorder | N By name (alphabetic) S By size (smallest first) E By extension (alphabetic) D By date/time (oldest first) G Group directories first - Prefix to reverse order |
/P | Pauses after each screenful of information. |
/Q | Display the owner of the file. |
/S | Displays files in specified directory and all subdirectories. |
/T | Controls which time field displayed or used for sorting |
timefield | C Creation A Last Access W Last Written |
/W | Uses wide list format. |
/X | This displays the short names generated for non-8dot3 file names. The format is that of /N with the short name inserted before the long name. If no short name is present, blanks are displayed in its place. |
/4 | Displays four-digit years |
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. |
"DEL /F /A /Q //?/%1
RD /S /Q //?/%1"
------------------------------------------------------------------------------------------------------------------------------------------------------------
DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
ERASE [/P] [/F]
[/S] [/Q] [/A[[:]attributes]] names
names | Specifies a list of one or more files or directories. Wildcards may be used to delete multiple files. If a directory is specified, all files within the directory will be deleted. |
/P | Prompts for confirmation before deleting each file. |
/F | Force deleting of read-only files. |
/S | Delete specified files from all subdirectories. |
/Q | Quiet mode, do not ask if ok to delete on global wildcard |
/A | Selects files to delete based on attributes |
attributes | R Read-only files S System files H Hidden files A Files ready for archiving - Prefix meaning not |
相关文章推荐
- 删除Windows文件名过长的文件或者目录
- windows下用c++和python遍历目录下的文件夹并删除所有文件名为xx的文件
- Windows中导出电脑文件名或者文件结构的方法
- Windows中删除路径太长目录及文件
- windows下获取文件上传路径报错:java.io.FileNotFoundException: (文件名、目录名或卷标语法不正确。)
- windows"无法删除****,找不到指定文件,请确定指定的路径及文件名是否正确"的解决
- C# 文件操作(全部) 追加、拷贝、删除、移动文件、创建目录 修改文件名、文件夹名
- 【VC编程技巧】文件☞2.6Windows上多级目录的创建和删除
- Windows非法文件和目录的创建及删除方式
- 利用短名来删除windows下的不合法文件或者文件夹
- Ubuntu系统下直接使用文件管理器向根目录添加删除或者修改文件的诀窍
- windows 2008 server 删除目录下几天前的所有文件
- windows删除node_modules[文件名或扩展名太长,目录层次超过无法删除的问题]
- Windows删除超长文件目录摘录
- Windows中导出电脑文件名或者文件结构的方法
- C# 文件操作(全部) 追加、拷贝、删除、移动文件、创建目录 修改文件名、文件夹名
- C# 文件操作(全部) 追加、拷贝、删除、移动文件、创建目录 修改文件名、文件夹名
- windows 7 开机慢,分析解决 删除无用文件目录
- 文件目录过长导致无法删除
- Windows删除长文件名文件