中国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-10 06:56
47,811 topics / 349,897 posts / today 2 new / 48,255 members
DOS批处理 & 脚本技术(批处理室) » [Closed] How to classify files and move them to other folders?
Printable Version  1,764 / 1
Floor1 slw218856 Posted 2008-10-21 09:24
初级用户 Posts 75 Credits 133
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 ]
Floor2 slw218856 Posted 2008-10-21 13:58
初级用户 Posts 75 Credits 133
The problem is solved. I was too unclear about the usage of findstr.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023