Board logo

标题: [文件操作] 求助adb pull批量复制文件夹的批处理代码查错 [打印本页]

作者: w97711366    时间: 2016-4-26 08:42     标题: 求助adb pull批量复制文件夹的批处理代码查错

本帖最后由 pcl_test 于 2016-4-26 19:54 编辑

本人要从手机sdcard目录中拷贝根目录下的mtklog文件夹,但是因为遇到多个问题,有多个mtklog开关的文件夹,想一次全部拷贝出来,就通过读取sdcard目录列表,并从中选择要拷贝的文件夹名,然后拷贝,结果要拷贝时提示这个,
  1. C:\Users\duany\Desktop>set list=b.txt
  2. C:\Users\duany\Desktop>set ml=adb pull /storage/sdcard0/%a g:/m1000test
  3. C:\Users\duany\Desktop>for /F "delims=" %a in (b.txt) do (adb pull /storage/sdcard0/%a g:/m1000test )
  4. g:/m1000test ) esktop>(adb pull /storage/sdcard0/mtklog
  5. ' does not existstorage/sdcard0/mtklog
  6. g:/m1000test ) esktop>(adb pull /storage/sdcard0/mtklog1
  7. ' does not existstorage/sdcard0/mtklog1
  8. g:/m1000test ) esktop>(adb pull /storage/sdcard0/mtklog2
  9. ' does not existstorage/sdcard0/mtklog2
  10. g:/m1000test ) esktop>(adb pull /storage/sdcard0/mtklog3
  11. ' does not existstorage/sdcard0/mtklog3
复制代码
附上我写的代码:
  1. del /s /f /q d:\sdcard.txt
  2. del /s /f /q b.txt
  3. adb shell ls /storage/sdcard0/ >>d:\sdcard.txt
  4. setlocal ENABLEDELAYEDEXPANSION
  5. for /f "delims=" %%i in (d:\sdcard.txt) do (
  6.     echo %%i | find "mtklog"
  7.     if !errorlevel! == 0 (
  8.         >>b.txt echo %%i
  9.     )
  10. )
  11. ::设置文件列表
  12. set list=b.txt
  13. set ml=adb pull /storage/sdcard0/%%a g:/m1000test
  14. for /f "delims=" %%a in (b.txt) do (
  15. %ml%)
  16. pause
复制代码

作者: happy886rr    时间: 2016-4-26 21:01

g:/打反了吧,拉到本地用g:\才对。内核root了直接就可以从data分区拉,或者利用内存溢出漏洞直接获取临时权限把mtklog拉过来。直接cat不行吗?




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2