Copy specific files into subfolder in batch -
i have windows batch file i'm running move specific files subfolder.
@echo off echo start copy setlocal enabledelayedexpansion set source_dir=c:\users\paul.ikeda\support\sndatademo91\solidcad\inventor_in set dest_dir=c:\users\paul.ikeda\support\sndatademo91\solidcad\inventor_in\files import set filenames_to_copy=sn_router_1.ipt sn_router_2.ipt sn_router_3.ipt /r "%source_dir%" %%f in (%filenames_to_copy%) ( if exist "%%f" ( set file_dir=%%~dpf set file_intermediate_dir=!file_dir:%source_dir%=! echo file "%%f" xcopy /y "%%f" "%dest_dir%!file_intermediate_dir!" ) ) echo. pause
this copying 3 desired files subfolder, keeps going , creates subfolder in subfolder, copies 3 files again subsubfolder, , it's repeating many files in original source folder. want copy 3 files copy destination folder , stop there.
can spot problem? don't know enough batch code debug this.
if want copy files may suit you:
@echo off echo start copy set "source_dir=c:\users\paul.ikeda\support\sndatademo91\solidcad\inventor_in" set "dest_dir=c:\users\paul.ikeda\support\sndatademo91\solidcad\inventor_in\files import" set "filenames_to_copy=sn_router_1.ipt sn_router_2.ipt sn_router_3.ipt" pushd "%source_dir%" %%f in (%filenames_to_copy%) ( echo file "%%f" xcopy /y "%%f" "%dest_dir%\" ) popd echo. done pause
Comments
Post a Comment