[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
本帖最后由 zaqmlp 于 2020-10-17 15:30 编辑

第一个
  1. @echo off
  2. cd /d "%~dp0"
  3. set "txtfile=xxx.txt"
  4. type nul>"%txtfile%"
  5. for %%a in (C D E F) do (
  6.     if exist %%a:\ (
  7.         echo;%%a Searching……
  8.         (for /f "delims=" %%b in ('dir /ad/b "%%a:\" 2^>nul') do (
  9.             echo;%%a/%%b
  10.             for /f "delims=" %%c in ('dir /ad/b "%%a:\%%b\" 2^>nul') do (
  11.                 echo;%%a/%%b/%%c
  12.             )
  13.         ))>>"%txtfile%"
  14.     )
  15. )
  16. pause
  17. exit
复制代码
第二个

convert.exe
http://bcn.bathome.net/tool/ImageMagick,6.9.2-6/convert.exe
  1. @echo off
  2. cd /d "%~dp0"
  3. rem 水印位置,0为中心,1为左上角,2为右上角,3为左下角,4为右下角
  4. set direction=1
  5. set "oldfolder=."
  6. set "newfolder=.\新建文件夹"
  7. set "logopic=.\水印.png"
  8. set "exefile=.\convert.exe"
  9. if not exist "%newfolder%" md "%newfolder%"
  10. if not exist "%oldfolder%" (echo;"%oldfolder%" not found&pause&exit)
  11. if not exist "%logopic%" (echo;"%logopic%" not found&pause&exit)
  12. if not exist "%exefile%" (echo;"%exefile%" not found&pause&exit)
  13. if "%oldfolder:~-1%" equ "\" set "oldfolder=%oldfolder:~,-1%"
  14. if "%newfolder:~-1%" equ "\" set "newfolder=%newfolder:~,-1%"
  15. set gravity=Center
  16. if "%direction%" equ "1" set gravity=northwest
  17. if "%direction%" equ "2" set gravity=northeast
  18. if "%direction%" equ "3" set gravity=southwest
  19. if "%direction%" equ "4" set gravity=southeast
  20. for /f "delims=" %%a in ('dir /a-d/b "%oldfolder%\*.jpg"') do (
  21.     echo;"%%a"
  22.     "%exefile%" "%oldfolder%\%%~nxa" "%logopic%" -gravity %gravity% -geometry +3+3 -composite "%newfolder%\%%~nxa"
  23. )
  24. :end
  25. pause
  26. exit
复制代码
提供bat代写,为你省时省力省事,支付宝扫码头像支付
微信: unique2random

TOP

返回列表