Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- IF "%~2"=="" GOTO Syntax
- IF "%~1"=="" GOTO Syntax
- REM **** Change the below lines accoring your installation
- SET PUTTYSCP_BIN="C:\Program Files (x86)\PuTTY\pscp.exe"
- SET PUTTY_BIN="C:\Program Files (x86)\PuTTY\putty.exe"
- REM SET RASPBERRYPI_ADDR=192.168.1.155
- SET RASPBERRYPI_ADDR=%1
- SET USERNAME=dhahaj
- SET PASSWORD=jnco
- REM SET CMD_FILENAME=make.sh
- REM **** Change the below Paths to the Path to your files on your PC and the location on your Raspberry Pi
- REM SET SRCPATH=%USERPROFILE%\RaspberryFiles
- SET SRCPATH=%2
- REM SET DST=/home/dhahaj/transfers
- IF "%~3"=="" (SET DST=/home/dhahaj/transfers) ELSE SET DST="%~3"
- REM **** The below will copy all .c and .h files to your Raspberry Pi
- REM SET SRC=%SRCPATH%\*.c
- REM %PUTTYSCP_BIN% -pw %PASSWORD% "%SRC%" %USERNAME%@%RASPBERRYPI_ADDR%:"%DST%"
- REM SET SRC=%SRCPATH%\*.h
- REM %PUTTYSCP_BIN% -pw %PASSWORD% "%SRC%" %USERNAME%@%RASPBERRYPI_ADDR%:"%DST%"
- SET SRC=%SRCPATH%
- %PUTTYSCP_BIN% -pw %PASSWORD% "%SRC%" %USERNAME%@%RASPBERRYPI_ADDR%:"%DST%"
- REM **** The below will execute all commands in your file make.sh (THIS MUST BE LOCAL ON YOUR PC)
- REM %PUTTY_BIN% -v -pw %PASSWORD% -m "%SRCPATH%"\make.sh %USERNAME%@%RASPBERRYPI_ADDR%
- GOTO:EOF
- :Syntax
- ECHO.
- ECHO rasp_transfer.bat, Version 1.00
- ECHO Transfers files to your raspberry PI.
- ECHO.
- ECHO Usage: rasp_transfer address source_dir dest_dir
- ECHO.
- ECHO Where: address The IP address of the raspberryPI.
- ECHO source_dir (mandatory) The local source directory.
- ECHO dest_dir (optional) The remote target directory.
- ECHO defaults to the home directory.
- ECHO Notes:
- ECHO [1] ASCII to Unicode conversion command and header by Jacques Bensimon.
- ECHO [2] For 32-bit Windows versions, the Unicode file header is created by an
- ECHO "embedded" DEBUG script.
- ECHO In 64-bit Windows versions either an "external" header file or ECHO is used
- ECHO to create the header.
- ECHO Unfortunately, ECHO inserts an extra line break before the original text.
- ECHO [3] The path of the temporary file is hard coded in the embedded DEBUG script.
- ECHO [4] DEBUG script code based on an article by "JustBurn":
- ECHO www.instructables.com/id/How-to-write-the-world-s-smallest-"Hello-World!"-e
- ECHO.
Add Comment
Please, Sign In to add comment