Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 批处理命令将png文件移动到文件夹同名文件和文件夹_Batch File - Fatal编程技术网

Batch file 批处理命令将png文件移动到文件夹同名文件和文件夹

Batch file 批处理命令将png文件移动到文件夹同名文件和文件夹,batch-file,Batch File,我想使用批处理dos将png文件移动到同名文件和文件夹中 Example:- abc <= folder adc.png => abc\abc.png abc1 <= folder adc1.png => abc1\abc1.png a b c <= folder a d c.png => a b c\a b c.png A b c D <= folder A b c D.png

我想使用批处理dos将png文件移动到同名文件和文件夹中

Example:-
abc <= folder 
adc.png          => abc\abc.png

abc1 <= folder 
adc1.png          => abc1\abc1.png

a b c <= folder 
a d c.png          => a b c\a b c.png

A b c D <= folder 
A b c D.png          => A b c D\A b c D.png

etc.
示例:-
abc\abc.png
abc1 abc1\abc1.png
a b c a b c\a b c.png
A b c D A b c D\A b c D.png
等

类似这样的内容…

注意,只有在键入cmd时,此选项才起作用。您需要加倍
%
未找到签名文件:(请以更容易理解的方式格式化目录树。
for /F "Tokens=* delims=" %%I in ('dir /a-d /b *.png') do (
   mkdir "%%~nI"
   move "%%~I" "%%~nI/%%~I"
)