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-10 05:51
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Closed] How to classify files and move them to other folders? View 1,762 Replies 1
Original Poster Posted 2008-10-21 09:24 ·  中国 江苏 苏州 电信
初级用户
★★
Credits 133
Posts 75
Joined 2008-08-03 01:08
18-year member
UID 122677
Gender Male
Status Offline
Below is the code:
move /y 新包青天*.wmv "D:\Media\新包青天" >nul 2>nul
for /f "delims=" %%a in ('dir /b /s /a-d "c:\Media" ^| findstr /v 新包青天*.wmv ') do (
move /y %%a "D:\Media"
)
After running, this P (the P made is also in this folder) is also moved away.
Question: How to achieve that this P is not moved away in the original place? Thanks

[ Last edited by HAT on 2008-10-21 at 15:40 ]
Floor 2 Posted 2008-10-21 13:58 ·  中国 江苏 苏州 电信
初级用户
★★
Credits 133
Posts 75
Joined 2008-08-03 01:08
18-year member
UID 122677
Gender Male
Status Offline
The problem is solved. I was too unclear about the usage of findstr.
Forum Jump: