繁体   English   中英

在子目录中发布文件重命名

[英]issue Rename files in sub directories

我正在尝试重命名下面的文件名。 如您所见,有些文件带有“ .DSD”。 所以我想删除这些“ .DSD”

我只是从这里引用其他分析

for /r %x in (*.DSD) do ren "%x" *.dad

但这不起作用,所以我应该怎么做?

    before                                        after
DDS1_150223.cpj.DSD                         DDS1_150223.cpj                 
DDS1_150211.cpj.DSD                         DDS1_150211.cpj
72 ranndom value.xls                        72 ranndom value.xls
FREQUENCY_AGILE_MEM.mif.DSD                 FREQUENCY_AGILE_MEM.mif
....                                        ...

此命令将起作用:

for /r %a in (*.DSD) do @move "%a" "%~pa%~na"

上面的命令使用了一些可选的语法:

%~I         - expands %I removing any surrounding quotes (")
%~fI        - expands %I to a fully qualified path name
%~dI        - expands %I to a drive letter only
%~pI        - expands %I to a path only
%~nI        - expands %I to a file name only
%~xI        - expands %I to a file extension only
%~sI        - expanded path contains short names only
%~aI        - expands %I to file attributes of file
%~tI        - expands %I to date/time of file
%~zI        - expands %I to size of file
%~$PATH:I   - searches the directories listed in the PATH
               environment variable and expands %I to the
               fully qualified name of the first one found.
               If the environment variable name is not
               defined or the file is not found by the
               search, then this modifier expands to the
               empty string

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM