Skip to content

Instantly share code, notes, and snippets.

@FantasyVR
Created October 27, 2017 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FantasyVR/e6afccb5c453619d18b7bf181e41feb6 to your computer and use it in GitHub Desktop.
Save FantasyVR/e6afccb5c453619d18b7bf181e41feb6 to your computer and use it in GitHub Desktop.
Windows上批量压缩文件的脚本
```
@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
```
@FantasyVR
Copy link
Author

将目录下面所有的MP4文件进行压缩,用到了7ZIP,Windows里环境变量需要将7Zip目录包含进去。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment