Browser Direct Download into Mbed

14 Sep 2011

Just a suggestion: It'll be cool to have a Chrome extension to automatically detect a .bin file being downloaded from the compiler, and subsequently search for a connected mbed, and store the .bin file directly to it. Or something for FireFox or IE9.

05 Nov 2011

I made a batch file that does this and associated it with the .bin extension, when i hit compile the file is downloaded & shown in the downloads bar (i use chrome) and when i click it it is "executed" and thus copied to the first volume found that has the name "MBED". in my case i rename the file to mbed.bin when moving, that way the old file is always overwritten and i don't have to worry about filling the mbed drive.

@echo off

for %%a in (D E F G H I J K L M N) do (
for /f "tokens=6 delims= " %%i in ('vol %%a: ^|find "MBED"') do (
echo %%i | find "MBED" > nul
if not errorlevel 1 call :gotdrive %%a: %1
)
) 2> nul
goto nodrive

:gotdrive
echo Drive letter of MBED is %1
echo File to copy is %~f2 will be renamed to mbed.bin
copy "%~f2" %1mbed.bin /Y

rem echo File to move is %~f2
rem move "%~f2" %1
exit

:nodrive
echo *******MBED was not found**********
color C
pause
exit