CMD/ADB - Autorun script to search, copy, and paste a file from android system to flash drive

Posted by Outride on Super User See other posts from Super User or by Outride
Published on 2014-06-01T23:39:07Z Indexed on 2014/06/02 9:32 UTC
Read the original article Hit count: 264

Filed under:
|
|

I've looked around and can't find anything that answers my question. This is my first question, so any tips or thoughts are welcome, as well as an answer :p

As explained in title, i want to create a script that launches, finds a file on android phone, copies it, and pastes it to a flash drive. As of right now, it's a mix of multiple tutorials, trial and error, and I'm at a point of giving up.

As of right now, I have a flash drive, loaded with three scripts. As follows: Bold = name of file

file.bat
@echo off
:: variables
/min
SET odrive=%odrive:~0,2%
set backupcmd=xcopy /s /c /d /e /h /i /r /y
echo off
%backupcmd% "C:\Users\Outride\Desktop\kikDatabase.db" "%drive%\all"
@echo off
cls

invisible.vbs
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

launch.bat
wscript.exe \invisible.vbs file.bat

So far, I had to use android commander, manually go through the directory, find /data/data/kik.android/databases and then copy kikDatabase.db to my desktop. Then run this scrip. Yes i'm trying to pull the database to copy all my email contacts.

I use launch.bat, which then makes file.bat invisible due to the invisible.vbs script. What would i need to do now to have the file searched for and copied to the flashdrive?

Thanks in advance, i'll be glad to answer any questions if theres any :p just remember that i'm not exactly a tech expert haha

EDIT* Cleared junk of prior edits.
New - I now have a .bat script to recognize what drive the usb is on, and launch py_cmd (adb shell)
This is the current script.

pull.bat
@echo off
:: variables
SET odrive=%odrive:~0,2%
set launching=start "%drive%\Minimal ADB and Fastboot\py_cmd"
echo off
%launching%

so how could I make it for the .bat or a new script, to type the following "adb pull /data/data/kik.android/databases/ %drive%\All\Database" into the adb terminal? please help! I've been racking my brain over this all night :3

© Super User or respective owner

Related posts about batch

Related posts about android