本帖最后由 zaqmlp 于 2020-10-17 15:30 编辑
第一个- @echo off
- cd /d "%~dp0"
- set "txtfile=xxx.txt"
- type nul>"%txtfile%"
- for %%a in (C D E F) do (
- if exist %%a:\ (
- echo;%%a Searching……
- (for /f "delims=" %%b in ('dir /ad/b "%%a:\" 2^>nul') do (
- echo;%%a/%%b
- for /f "delims=" %%c in ('dir /ad/b "%%a:\%%b\" 2^>nul') do (
- echo;%%a/%%b/%%c
- )
- ))>>"%txtfile%"
- )
- )
- pause
- exit
复制代码 第二个
convert.exe
http://bcn.bathome.net/tool/ImageMagick,6.9.2-6/convert.exe- @echo off
- cd /d "%~dp0"
- rem 水印位置,0为中心,1为左上角,2为右上角,3为左下角,4为右下角
- set direction=1
-
- set "oldfolder=."
-
- set "newfolder=.\新建文件夹"
-
- set "logopic=.\水印.png"
-
- set "exefile=.\convert.exe"
-
- if not exist "%newfolder%" md "%newfolder%"
- if not exist "%oldfolder%" (echo;"%oldfolder%" not found&pause&exit)
- if not exist "%logopic%" (echo;"%logopic%" not found&pause&exit)
- if not exist "%exefile%" (echo;"%exefile%" not found&pause&exit)
-
- if "%oldfolder:~-1%" equ "\" set "oldfolder=%oldfolder:~,-1%"
- if "%newfolder:~-1%" equ "\" set "newfolder=%newfolder:~,-1%"
- set gravity=Center
- if "%direction%" equ "1" set gravity=northwest
- if "%direction%" equ "2" set gravity=northeast
- if "%direction%" equ "3" set gravity=southwest
- if "%direction%" equ "4" set gravity=southeast
- for /f "delims=" %%a in ('dir /a-d/b "%oldfolder%\*.jpg"') do (
- echo;"%%a"
- "%exefile%" "%oldfolder%\%%~nxa" "%logopic%" -gravity %gravity% -geometry +3+3 -composite "%newfolder%\%%~nxa"
- )
- :end
- pause
- exit
复制代码
|