android - Run adb commands from JavaScript with ActiveXObject -
i'm trying develop web tool automate bat files have run adb commands , so. part of work. can list devices, connect, disconnect , on. but, stuck push command. not work. here code send command:
function runcommand(cmd){ var shell_cmd = "cmd /c " + adb_path + cmd + " > c:\out.txt"; var wshshell = new activexobject("wscript.shell"); var execution = wshshell.run(shell_cmd,1,true); var fso = new activexobject("scripting.filesystemobject"); var fh = fso.opentextfile("c:\out.txt", 1); var text = fh.readall(); fh.close; return text;}
with command {path-to-adb}/adb.exe devices -l > c:out.txt
. can output, parse , list devices.
with command {path-to-adb}/adb.exe push folder system/folder c:out.txt
never copies folder. but, if run same command trough cmd line copy.
what can wrong? has used wscript.shell adb , had success?
wiki
Comments
Post a Comment