标题: [文件操作] 求助adb pull批量复制文件夹的批处理代码查错 [打印本页]
作者: w97711366 时间: 2016-4-26 08:42 标题: 求助adb pull批量复制文件夹的批处理代码查错
本帖最后由 pcl_test 于 2016-4-26 19:54 编辑
本人要从手机sdcard目录中拷贝根目录下的mtklog文件夹,但是因为遇到多个问题,有多个mtklog开关的文件夹,想一次全部拷贝出来,就通过读取sdcard目录列表,并从中选择要拷贝的文件夹名,然后拷贝,结果要拷贝时提示这个,- C:\Users\duany\Desktop>set list=b.txt
-
- C:\Users\duany\Desktop>set ml=adb pull /storage/sdcard0/%a g:/m1000test
-
- C:\Users\duany\Desktop>for /F "delims=" %a in (b.txt) do (adb pull /storage/sdcard0/%a g:/m1000test )
-
- g:/m1000test ) esktop>(adb pull /storage/sdcard0/mtklog
- ' does not existstorage/sdcard0/mtklog
-
- g:/m1000test ) esktop>(adb pull /storage/sdcard0/mtklog1
- ' does not existstorage/sdcard0/mtklog1
-
- g:/m1000test ) esktop>(adb pull /storage/sdcard0/mtklog2
- ' does not existstorage/sdcard0/mtklog2
-
- g:/m1000test ) esktop>(adb pull /storage/sdcard0/mtklog3
- ' does not existstorage/sdcard0/mtklog3
复制代码
附上我写的代码:- del /s /f /q d:\sdcard.txt
- del /s /f /q b.txt
- adb shell ls /storage/sdcard0/ >>d:\sdcard.txt
-
- setlocal ENABLEDELAYEDEXPANSION
-
- for /f "delims=" %%i in (d:\sdcard.txt) do (
- echo %%i | find "mtklog"
- if !errorlevel! == 0 (
- >>b.txt echo %%i
- )
- )
-
- ::设置文件列表
- set list=b.txt
-
- set ml=adb pull /storage/sdcard0/%%a g:/m1000test
-
- for /f "delims=" %%a in (b.txt) do (
- %ml%)
-
- pause
复制代码
作者: happy886rr 时间: 2016-4-26 21:01
g:/打反了吧,拉到本地用g:\才对。内核root了直接就可以从data分区拉,或者利用内存溢出漏洞直接获取临时权限把mtklog拉过来。直接cat不行吗?
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |