[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
rarPath设置为你winrar的路径
  1. @echo off & cd /d "%~dp0"
  2. set "rarPath=C:\Program Files\WinRAR"
  3. set "path=%path%;%rarPath%"
  4. set "dirList="
  5. for /d %%i in (*) do call set "dirList=%%dirList%% "%%i""
  6. for %%i in ("%cd%") do rar a "%%~nxi.rar" %dirList%
  7. pause&exit
复制代码

TOP

回复 5# 7803181
  1. @echo off & cd /d "%~dp0"
  2. setlocal enabledelayedexpansion
  3. set "rarPath=C:\Program Files\WinRAR"
  4. set "path=%path%;%rarPath%"
  5. set "dirList="
  6. for /r /d %%i in (*) do (
  7. pushd "%%i"
  8. for /l %%a in (1,1,2) do cd ..
  9. if "!cd!\"=="%~dp0" (
  10. echo pack %%i
  11. pushd "%%i"
  12. set "dirList="
  13. for /d %%i in (*) do call set "dirList=!dirList! "%%i""
  14. for %%i in ("!cd!") do rar a "%%~nxi.rar" !dirList!
  15. popd
  16. echo ------------------
  17. )
  18. popd
  19. )
  20. pause&exit
复制代码

TOP

返回列表