I have next code and it work开发者_如何学Pythons 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.
Thanks, Tiho
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"
精彩评论