中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-03 08:54
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » Create folders with the same names and move files into the folders
Printable Version  993 / 2
Floor1 bbq123bbq Posted 2007-02-07 12:26
初级用户 Posts 77 Credits 197
Floor2 zh159 Posted 2007-02-07 14:03
金牌会员 Posts 1,467 Credits 3,687
Can't catch my breath anymore......
Floor3 slore Posted 2007-02-09 03:11
铂金会员 Posts 2,478 Credits 5,212

  1. @echo off
  2. @rem %FileFolder% is the directory where the files to be moved are located (do not include spaces)
  3. set FileFolder="Movie"
  4. dir .\%FileFolder% /B>FileList.txt
  5. For /F "tokens=1,2 delims=0" %%i in (FileList.txt) do (
  6. if not exist ".\%FileFolder%\%%i" md ".\%FileFolder%\%%i"
  7. move ".\%FileFolder%\%%i0%%j" ".\%FileFolder%\%%i"
  8. )
  9. del FileList.txt
  10. @echo Move operation completed, press any key to exit.
  11. pause
Posted by SLore: 2007-02-08 14:05

[ Last edited by slore on 2007-2-8 at 02:16 PM ]
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023