Windows 7 Batch - Create subfolder, then find files with certain text in file name and move those files in the newly created subfolder -


tried best searching solution close need example did not work. bash: moving multiple files subfolders

i not programmer unable create batch file myself windows 7. appreciated.


needed code batch file following:-

  1. searches folder files have "_f1" in file name
  2. creates subfolder named "f1" file located
  3. move files searched in step 1 folder "f1" created in step 2

ideally, batch file should execute parent folder , should complete 3 steps in subfolders @ least till 3 levels down parent folder.


thanks in advance help.


i tried , came this. works, raw. needs run manually inside of each folder (100's of them)

mkdir f1   mkdir f2   500  move *_f1*.* f1  move *_f2*.* f2  enddo 

try :

@echo off /f "delims=" %%a in ('dir /s/b/a-d *.* ^| find /i "_f1"') ( if not exist "%%~dpaf1" md "%%~dpaf1" move "%%~fa" "%%~dpaf1") 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -