[英]Windows 7 Batch - Create subfolder, then find files with certain text in file name and move those files in the newly created subfolder
Tried my best searching for a solution but close to my need was this example which did not work.尽我最大的努力寻找解决方案,但接近我的需要的是这个没有工作的例子。 Bash: Moving multiple files into subfolders
Bash:将多个文件移动到子文件夹中
I am not a programmer so unable to create the batch file myself for Windows 7. Any help will be appreciated.我不是程序员,因此无法自己为 Windows 7 创建批处理文件。任何帮助将不胜感激。
Needed code for a batch file that does the following:-执行以下操作的批处理文件所需的代码:-
Ideally, the batch file should execute from parent folder and should complete the 3 steps in all subfolders at least till 3 levels down the parent folder.理想情况下,批处理文件应从父文件夹执行,并应在所有子文件夹中完成 3 个步骤,至少到父文件夹下 3 个级别。
Thanks in Advance for any help.在此先感谢您的帮助。
I tried and came up with this.我尝试并想出了这个。 Works, but is very raw.
有效,但非常原始。 Needs to be run manually from inside of each folder (100's of them)
需要从每个文件夹内部手动运行(其中 100 个)
MKDIR F1
MKDIR F2
DO 500
move *_F1*.* F1
move *_F2*.* F2
ENDDO
Try like this :像这样尝试:
@echo off
for /f "delims=" %%a in ('dir /s/b/a-d *.* ^| find /i "_F1"') do (
if not exist "%%~dpaF1" md "%%~dpaF1"
move "%%~fa" "%%~dpaF1")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.