Guest User

Untitled

a guest
Apr 27th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. @ECHO OFF
  2.  
  3. IF "%~2"=="" GOTO Syntax
  4. IF "%~1"=="" GOTO Syntax
  5.  
  6. REM **** Change the below lines accoring your installation
  7. SET PUTTYSCP_BIN="C:\Program Files (x86)\PuTTY\pscp.exe"
  8. SET PUTTY_BIN="C:\Program Files (x86)\PuTTY\putty.exe"
  9. REM SET RASPBERRYPI_ADDR=192.168.1.155
  10. SET RASPBERRYPI_ADDR=%1
  11.  
  12. SET USERNAME=dhahaj
  13. SET PASSWORD=jnco
  14.  
  15. REM SET CMD_FILENAME=make.sh
  16.  
  17. REM **** Change the below Paths to the Path to your files on your PC and the location on your Raspberry Pi
  18. REM SET SRCPATH=%USERPROFILE%\RaspberryFiles
  19. SET SRCPATH=%2
  20. REM SET DST=/home/dhahaj/transfers
  21. IF "%~3"=="" (SET DST=/home/dhahaj/transfers) ELSE SET DST="%~3"
  22.  
  23. REM **** The below will copy all .c and .h files to your Raspberry Pi
  24. REM SET SRC=%SRCPATH%\*.c
  25. REM %PUTTYSCP_BIN% -pw %PASSWORD% "%SRC%" %USERNAME%@%RASPBERRYPI_ADDR%:"%DST%"
  26. REM SET SRC=%SRCPATH%\*.h
  27. REM %PUTTYSCP_BIN% -pw %PASSWORD% "%SRC%" %USERNAME%@%RASPBERRYPI_ADDR%:"%DST%"
  28.  
  29. SET SRC=%SRCPATH%
  30. %PUTTYSCP_BIN% -pw %PASSWORD% "%SRC%" %USERNAME%@%RASPBERRYPI_ADDR%:"%DST%"
  31.  
  32. REM **** The below will execute all commands in your file make.sh (THIS MUST BE LOCAL ON YOUR PC)
  33. REM %PUTTY_BIN% -v -pw %PASSWORD% -m "%SRCPATH%"\make.sh %USERNAME%@%RASPBERRYPI_ADDR%
  34.  
  35. GOTO:EOF
  36.  
  37. :Syntax
  38. ECHO.
  39. ECHO rasp_transfer.bat, Version 1.00
  40. ECHO Transfers files to your raspberry PI.
  41. ECHO.
  42. ECHO Usage: rasp_transfer address source_dir dest_dir
  43. ECHO.
  44. ECHO Where: address The IP address of the raspberryPI.
  45. ECHO source_dir (mandatory) The local source directory.
  46. ECHO dest_dir (optional) The remote target directory.
  47. ECHO defaults to the home directory.
  48. ECHO Notes:
  49. ECHO [1] ASCII to Unicode conversion command and header by Jacques Bensimon.
  50. ECHO [2] For 32-bit Windows versions, the Unicode file header is created by an
  51. ECHO "embedded" DEBUG script.
  52. ECHO In 64-bit Windows versions either an "external" header file or ECHO is used
  53. ECHO to create the header.
  54. ECHO Unfortunately, ECHO inserts an extra line break before the original text.
  55. ECHO [3] The path of the temporary file is hard coded in the embedded DEBUG script.
  56. ECHO [4] DEBUG script code based on an article by "JustBurn":
  57. ECHO www.instructables.com/id/How-to-write-the-world-s-smallest-"Hello-World!"-e
  58. ECHO.
Add Comment
Please, Sign In to add comment