China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-03 09:54
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Create folders with the same names and move files into the folders View 995 Replies 2
Original Poster Posted 2007-02-07 12:26 ·  中国 广东 广州 花都区 电信
初级用户
★★
Credits 197
Posts 77
Joined 2006-09-19 14:02
19-year member
UID 63074
Gender Male
Status Offline
Floor 2 Posted 2007-02-07 14:03 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Can't catch my breath anymore......
Floor 3 Posted 2007-02-09 03:11 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline

  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 ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +10 2007-02-09 03:18
Forum Jump: