本帖最后由 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
复制代码
|