Skip to content

Instantly share code, notes, and snippets.

Last active March 12, 2020 18:33
What would you like to do?
@echo off
REM Usage: send_files.cmd <path to scripts dir> <file with ip addresses>
rem example: C:\\TRIKStudio\\send_files.cmd C:\Users\Dell\Desktop\send_files ip_adr.txt
Setlocal EnableDelayedExpansion
set TRIK_DIR=%~dp0
set WINSCP_PATH=%TRIK_DIR%\winscp\
SET mydir=%cd%
set PUT_ALL=
pushd "%SCRIPT_PATH%"
for %%f in (*.js) do (
set PUT_ALL=!PUT_ALL! "put %%f"
for /f "usebackq" %%A in ("%SCRIPT_PATH%\%2") do (
set OPEN_IP="open scp://root@%%A"
"%WINSCP_PATH%" /command !OPEN_IP! "cd /home/root/trik/scripts/" %PUT_ALL% exit < CON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment