本帖最后由 smss 于 2019-5-11 20:43 编辑
用7Z压缩拖入文件夹下子文件夹
如果用for /d %%i in (*) do "%zip%" a "%1\%%i.zip" "%%i" 得到的是含子文件目录的压缩包 只能用最笨的方法逐个CD到对应文件夹再执行压缩命令 于是就有了如下的- if exist %1\clock_2x4 (cd %1\clock_2x4&for /d %%i in (*) do "%zip%" a "%1\A\clock_2x4.zip" "%%i")
- if exist %1\com.android.calculator2 (cd %1\com.android.calculator2&for /d %%i in (*) do "%zip%" a "%1\A\com.android.calculator2.zip" "%%i")
- if exist %1\com.android.soundrecorder (cd %1\com.android.soundrecorder&for /d %%i in (*) do "%zip%" a "%1\A\com.android.soundrecorder.zip" "%%i")
- if exist %1\com.android.appshare (cd %1\com.android.appshare&for /d %%i in (*) do "%zip%" a "%1\A\com.android.appshare.zip" "%%i")
- if exist %1\com.android.contacts (cd %1\com.android.contacts&for /d %%i in (*) do "%zip%" a "%1\A\com.android.contacts.zip" "%%i")
- if exist %1\com.android.deskclock (cd %1\com.android.deskclock&for /d %%i in (*) do "%zip%" a "%1\A\com.android.deskclock.zip" "%%i")
- if exist %1\com.android.fileexplorer (cd %1\com.android.fileexplorer&for /d %%i in (*) do "%zip%" a "%1\A\com.android.fileexplorer.zip" "%%i")
复制代码 需求是打包%1下所有子文件夹(不包含子文件夹本身目录) |