其他分享
首页 > 其他分享> > bat批量备份照片和视频

bat批量备份照片和视频

作者:互联网

 

 

 

@echo off
REM adb工具包文件夹
set "adbPath=G:\Phone\tool"
REM 照片保存文件夹
set "imgPath=G:\DCIM"
REM 视频保存文件夹
set "mp4Path=G:\video"
set "path=%path%;%adbPath%"
REM 检测设备
adb devices | findstr /e /i "device" >nul 2>nul || ( adb devices & echo No Devices! & pause&exit )
mkdir "%imgPath%" "%mp4Path%" >nul 2>nul
REM 备份照片
for /f "delims=" %%i in ('adb shell find /sdcard/dcim -name "*.jpg"') do (
    set /p "=pull %%i  "<nul
    if not exist "%imgPath%\%%~nxi" (
        adb pull "%%i" "%imgPath%\%%~nxi" >nul 2>nul
        echo done!
    ) else echo skip 
)
REM 备份视频
for /f "delims=" %%i in ('adb shell find /sdcard/dcim -name "*.mp4"') do (
    set /p "=pull %%i  "<nul
    if not exist "%mp4Path%\%%~nxi" (
        adb pull "%%i" "%mp4Path%\%%~nxi" >nul 2>nul
        echo done!
    ) else echo skip 
)
pause&exit

 

标签:bat,set,批量,%%,备份,echo,nul,adb,REM
来源: https://www.cnblogs.com/ai594ai/p/15019953.html