Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有他的名字:
fd3_xxx fd3_xx1 fd3_xx2 fd6_xxx fd6_xx1 fd6_xx2
如何编写一个批处理文件,将所有“fd3”文件放入名为“fd3”的文件夹中,并将所有“fd6”文件放入名为“fd6”的文件夹中。
@echo off for %%a in (*.*) do ( for /F "delims=_" %%b in ("%%a") do ( if not exist "%%b" md "%%b" move "%%a" "%%b" ) )
这应该这样做
xcopy fd3_* fd3 /i xcopy fd6_* fd6 /i del fd3_* /f /q del fd6_* /f /q
也许先在一些测试文件夹上尝试它,以确保它符合您的要求。