[REF] Making use of Windows "Send to" menu

Search This thread

xan

Retired Recognized Developer
May 21, 2006
1,407
454
Crack-ow
Pushing files over adb has never been easy. There are some external tools for sending files over adb, but I like native, Windows-integrated ones.

The trick is extremely easy. It works with adbWireless and similar applications. It could work with USB connection too, but I rarely use it.

HEADS UP: Be sure to check all nice(r) scripts by Daneshm90 down the thread!

Prerequisites:
-adb
-adbMagic or similar for wifi connection, none for USB only.

How to?
For better look you will need two files:

adb_send.cmd;
Code:
adb connect 192.168.1.103
adb push %1 /sdcard/
pause
and a shortcut to it, where you can customize icon and name.

1) create your adb_send.cmd anywhere on disk (I put mine in android-sdk-windows\tools directory),
2) customize the ip address, to point at your device (I have router with static DHCP, so everytime my device connects it leases the same address)
3) then go to:
Windows Vista/7:
Code:
%APPDATA%\Microsoft\Windows\SendTo
(paste it in explorer's address bar, or hit WIN+R and paste there, Enter), and place shortcut to script file created earlier. (drag it with right mouse button)
4) customize the icon and name of the shortcut :)
Next time you click on any file menu appears:
 

Attachments

  • Untitled.png
    Untitled.png
    12.3 KB · Views: 918
Last edited:
  • Like
Reactions: sUsH667

xan

Retired Recognized Developer
May 21, 2006
1,407
454
Crack-ow
hmm..
I think there is. Right click on the shortcut (this in "%APPDATA%\Microsoft\Windows\SendTo")properities -> run -> minimised

Delete "pause" line from script, and command line is hidden.
 

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
661
How's this :

Code:
@echo off
echo Where to push the file ? eg (/data/1.apk)
SET /P pat=Enter :
echo Pushing...
adb push "%1" /sdcard/%~n1
adb shell su -c "cp /sdcard/%~n1 %pat%" -root
adb shell rm /sdcard/%~n1
echo Done
 
Last edited:

dhiru1602

Inactive Recognized Developer
Aug 23, 2010
1,865
13,668
It works directly for me.

Right click the file, Send to - > Bluetooth Devices.

Select my Phone and press Send.
 

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
661
Very cool tip, made a couple different cmd shortcuts to copy to different part of the sdcard(roms/apps/misc).

The script i posted above does just that except you don't need multiple shortcuts.

When you run it'll as you where u want the file to go.
 

borgen92

Member
Apr 30, 2010
12
0
Thanks for the tip.

And Daneshm90 i tried your command, but..is there a way to do it without su? Since when i try ur command i always have to accept the root request, and it dosnt seem to push the file right anyway. So im asking is there a way to do it without su? Cuz if i do the original i dont need to press the root request all the time.

Thanks in advance mate.
 

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
661
Thanks for the tip.

And Daneshm90 i tried your command, but..is there a way to do it without su? Since when i try ur command i always have to accept the root request, and it dosnt seem to push the file right anyway. So im asking is there a way to do it without su? Cuz if i do the original i dont need to press the root request all the time.

Thanks in advance mate.

It should only ask you to accept once, not everytime.

Well sure i can modify mine where if u say /sdcard/ then it doesn't do that whole root crap and just pushes to sdcard.

Gimme a few.
 

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
661
Here try this one

Code:
@echo off
echo Where to push the file ? eg (/data/1.apk)
SET /P pat=Enter :
if not "%pat:sdcard=%"=="%pat%" goto sdcard
echo Pushing...
adb push %1 /sdcard/%~n1
adb shell su -c "cp /sdcard/%~n1 %pat%" -root
adb shell rm /sdcard/%~n1
echo Done
:sdcard
echo Pushing...
adb push %1 %pat%
echo Done

Note, if you have a rom where when you do "adb shell" and ur automatically in "su" mode. Then u can simply change the script to :

Code:
@echo off
echo Where to push the file ? eg (/data/1.apk)
SET /P pat=Enter :
echo Pushing...
adb push %1 %pat%
echo Done
 
Last edited:

foxdog66

Senior Member
Jul 28, 2010
471
53
Here try this one

Code:
@echo off
echo Where to push the file ? eg (/data/1.apk)
SET /P pat=Enter :
if not "%pat:sdcard=%"=="%pat%" goto sdcard
echo Pushing...
adb push %1 /sdcard/%~n1
adb shell su -c "cp /sdcard/%~n1 %pat%" -root
adb shell rm /sdcard/%~n1
echo Done
:sdcard
echo Pushing...
adb push %1 %pat%
echo Done

Note, if you have a rom where when you do "adb shell" and ur automatically in "su" mode. Then u can simply change the script to :

Code:
@echo off
echo Where to push the file ? eg (/data/1.apk)
SET /P pat=Enter :
echo Pushing...
adb push %1 %pat%
echo Done

thats awesome, how would one make it crate and copy the folder structure as well? did this with a folder with pics in it and it just put every pic on the root of my sd card.

or how about asking for ip then using what was imputed?
 
Last edited:

wacckkoo1

Member
Dec 4, 2009
15
9
Send To Menu For ADB Install

You can modify the above instructions to use the Send to Menu to install applications over wireless.

Code:
adb connect 192.168.1.46:5555
adb install %1
pause

Substitute your IP address for 192.168.1.46 (may or may not need the port)

Save your Install.cmd or anything.cmd anywhere on your hardisk. Make a shortcut in
Code:
 %APPDATA%\Microsoft\Windows\SendTo
to the .cmd.

Right click an .apk and select Send To -> Install.cmd

Works like a dream using my Nexus 1 and adbWireless
 

foxdog66

Senior Member
Jul 28, 2010
471
53
nice one @wacckkoo1

this has so much potential.

i found an app on the market called ADB over WIFI widget. it dosent care if your connected to wifi or not, it will just start, making this possable to do while wireless tethering to a laptop

thats why im wanting to know how i can get it to ask for ip address because it wont always be the same.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Pushing files over adb has never been easy. There are some external tools for sending files over adb, but I like native, Windows-integrated ones.

    The trick is extremely easy. It works with adbWireless and similar applications. It could work with USB connection too, but I rarely use it.

    HEADS UP: Be sure to check all nice(r) scripts by Daneshm90 down the thread!

    Prerequisites:
    -adb
    -adbMagic or similar for wifi connection, none for USB only.

    How to?
    For better look you will need two files:

    adb_send.cmd;
    Code:
    adb connect 192.168.1.103
    adb push %1 /sdcard/
    pause
    and a shortcut to it, where you can customize icon and name.

    1) create your adb_send.cmd anywhere on disk (I put mine in android-sdk-windows\tools directory),
    2) customize the ip address, to point at your device (I have router with static DHCP, so everytime my device connects it leases the same address)
    3) then go to:
    Windows Vista/7:
    Code:
    %APPDATA%\Microsoft\Windows\SendTo
    (paste it in explorer's address bar, or hit WIN+R and paste there, Enter), and place shortcut to script file created earlier. (drag it with right mouse button)
    4) customize the icon and name of the shortcut :)
    Next time you click on any file menu appears: