Copy specific files into subfolder in batch

后端 未结 1 363
离开以前
离开以前 2021-01-27 03:37

I have a Windows Batch file that I\'m running to move specific files into a subfolder.

@ECHO OFF
ECHO Start Copy

setlocal enabledelayedexpansion

set SOURCE_DI         


        
1条回答
  •  醉话见心
    2021-01-27 04:02

    If you just want to copy the files then this 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 to Import"
    set "FILENAMES_TO_COPY=SN_Router_1.ipt SN_Router_2.ipt SN_Router_3.ipt"
    
    pushd "%SOURCE_DIR%"
    for %%F IN (%FILENAMES_TO_COPY%) do (
        echo file "%%F"
        xcopy /Y "%%F" "%DEST_DIR%\"
    )
    popd
    ECHO. done
    pause
    

    0 讨论(0)
提交回复
热议问题