移动文件使用批处理脚本文件的名称空间 [英] move files with spaces in file name using batch script
本文介绍了移动文件使用批处理脚本文件的名称空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我旁边code和它完美的作品就没有空格的文件名。
I have next code and it works perfectly as far as there are no spaces in file names.
FOR /F "usebackq tokens=1" %%n IN (`dir D:\Skripte\radno\temp /b`) DO @FOR /F "usebackq tokens=2,3,4 delims=. " %%d IN (`date /t`) DO @move D:\App\STE\_Isporuka\Doc\%%n \\gds21-bdc01\STE\Arhiva\Novo\Doc\%%f%%e%%d-%%n
我需要的文件相同的功能,在文件名中的空格。
I need same functionality for files with spaces in file names.
谢谢,
Tiho
Thanks, Tiho
推荐答案
您将需要在第二循环中设置一个空白分隔符的第一个for循环和引用的文件名:
You will need to set a blank delimiter to the first for loop and quote the filenames in the second loop:
FOR /F "usebackq tokens=1 delims=" %%n IN (`dir D:\Skripte\radno\temp /b`) DO @FOR /F "usebackq tokens=2,3,4 delims=. " %%d IN (`date /t`) DO @move "D:\App\STE\_Isporuka\Doc\%%n" "\\gds21-bdc01\STE\Arhiva\Novo\Doc\%%f%%e%%d-%%n"
这篇关于移动文件使用批处理脚本文件的名称空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文