1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | @echo off color 0a set /p SRC_PATH=來源路徑: set /p TAG_PATH=目標路徑: set /p FILE_EXT=副檔名: echo. :CLASS_RESTART cls echo. [來源路徑: "%SRC_PATH%" ] echo. [目標路徑: "%TAG_PATH%" ] echo. [副檔名: "%FILE_EXT%" ] echo. ================== echo. [選擇模式] echo. a: 更改來源路徑 echo. b: 更改目標路徑 echo. c: 更改副檔名 echo. m: 移動檔案 echo. n: 列出清單 echo. w: 交換路徑 echo. x: 離開程式 set /p ANSWER=">" if "%ANSWER%"=="m" goto CLASS_MOVE if "%ANSWER%"=="n" goto CLASS_LIST_FILES if "%ANSWER%"=="a" goto CLASS_EDIT_SRC_PATH if "%ANSWER%"=="b" goto CLASS_EDIT_TAG_PATH if "%ANSWER%"=="c" goto CLASS_EDIT_FILE_EXT if "%ANSWER%"=="w" goto CLASS_SWAP_PATH if "%ANSWER%"=="x" goto CLASS_EXIT goto CLASS_RESTART :CLASS_MOVE robocopy "%SRC_PATH%" "%TAG_PATH%" *."%FILE_EXT%" /s /V /NDL /IS /IT /eta /move goto CLASS_PRINTLOG :CLASS_LIST_FILES robocopy "%SRC_PATH%" "%TAG_PATH%" *."%FILE_EXT%" /s /L /V /NDL /IS /IT /eta echo. 是否產生記錄檔? set /p PRINTLOG=[y/n]: if "%PRINTLOG%"=="y" goto CLASS_PRINTLOG goto CLASS_RESTART :CLASS_EDIT_SRC_PATH set /p SRC_PATH=來源路徑: goto CLASS_RESTART :CLASS_EDIT_TAG_PATH set /p TAG_PATH=目標路徑: goto CLASS_RESTART :CLASS_EDIT_FILE_EXT set /p FILE_EXT=副檔名: goto CLASS_RESTART :CLASS_SWAP_PATH set TEMP_PATH=%SRC_PATH% set SRC_PATH=%TAG_PATH% set TAG_PATH=%TEMP_PATH% goto CLASS_RESTART :CLASS_PRINTLOG robocopy "%SRC_PATH%" "%TAG_PATH%" *."%FILE_EXT%" /s /L /V /NDL /IS /IT /eta /LOG+:記錄日誌%date:~0,4%%date:~5,2%%date:~8,2%.log goto CLASS_RESTART :CLASS_EXIT |
Direct link: https://paste.plurk.com/show/e5BanpLNg52EARTE2OVO