I'm tired of copying compiled binary file after downloading from the browser. So created this batch file for windows environment. Currently only check to work with HRM1017. Feel free to used it with other platform, but some modification could be required: 1. Only check D, E, F folder. 2. HRM1017 has "mbed.htm" in its folder. Used it as signature. 3. HRM1017 use "*.hex", other platform might use "*.bin"

I'm tired of having to copy the binary to mbed folder after compiling from the browser. So created this batch file for windows. It check for binary file every 5sec then automatically move the binary to mbed folder. Platform used is HRM1017. Some modification might be required to used for other platform:

1. Only check D, E, F folder.

2. HRM1017 use *.hex (other might use *.bin)

3. HRM1017 has "mbed.htm" in its folder. Using it as signature.

Run from download folder. There must be no other *.hex file in the folder.

Files at this revision

API Documentation at this revision

Comitter:
devsar
Date:
Sun Apr 05 14:02:29 2015 +0000
Commit message:
Initial Release.

Changed in this revision

mbed.bat Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bat	Sun Apr 05 14:02:29 2015 +0000
@@ -0,0 +1,35 @@
+@echo off
+rem This batch will periodically:
+rem   Check current folder if *.hex exist. (change to *.bin if required)
+rem   Search each drive in the list for "mbed.htm" file.
+rem   Then copy the file to that folder.
+rem Note:
+rem 1. Put this to where your browser download the compiled mbed file.
+rem 2. There must be no other *.hex file in that folder.
+rem 3. Only tested with HRM1017 (folder has "mbed.htm")
+rem 4. Periodically check and copy for 5sec.
+
+:START
+rem check if *.hex file exist, then copy it to mbed folder
+rem remove the file from folder after copy finished
+if exist *.hex (
+  rem check drive for "mbed.htm" file to determine
+  rem mbed drive folder...
+  for %%d in (d e f) do (
+    if exist %%d:\mbed.htm (set DRIVE=%%d)
+  )
+  
+  rem mbed folder not found, loop.
+  if "%DRIVE%"=="" goto LOOP
+
+  echo "Copying file..."
+  forfiles /m *.hex /c "cmd /c copy @file %DRIVE%:\" >nul
+  forfiles /m *.hex /c "cmd /c del @file" >nul
+)
+
+:LOOP
+rem wait for 5000ms = 5sec, before restarting
+ping 1.1.1.1 -n 1 -w 5000>nul
+goto START
+
+pause