Created
October 27, 2017 08:38
-
-
Save FantasyVR/e6afccb5c453619d18b7bf181e41feb6 to your computer and use it in GitHub Desktop.
Windows上批量压缩文件的脚本
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
@echo off | |
call :treeProcess | |
goto :eof | |
:treeProcess | |
rem Do whatever you want here over the files of this subdir, for example: | |
for %%f in (*.mp4) do echo %%f | |
for /D %%d in (*) do ( | |
cd %%d | |
call :treeProcess | |
for %%i in (*.mp4) do (7z a %%~ni.zip %%i) | |
cd .. | |
) | |
exit /b | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
将目录下面所有的MP4文件进行压缩,用到了7ZIP,Windows里环境变量需要将7Zip目录包含进去。