Created
February 2, 2017 19:50
-
-
Save ssokolow/b3752bfab83e31c48b2263da0370bddb to your computer and use it in GitHub Desktop.
Example scripts for easily sending/receiving files using the SSH2DOS SFTP client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM Usage: | |
REM 1. Set up your DOS network and packet drivers | |
REM 2. Install sftpd386.exe | |
REM 3. Edit the line which calls sftpd386.exe for path/credentials/IP address | |
REM 4. Run "sftpget file1 file2 file3 ..." | |
REM Write sftp script | |
( | |
@echo off | |
echo cd writable | |
FOR %%A in (%*) DO echo get %A | |
echo bye | |
) > %TEMP%\sftpscri.pt | |
REM Pipe it as input because -b doesn't seem to get along with -i | |
c:\apps\ssh2\sftpd386.exe -i c:\apps\ssh2\id_rsa nostalgia-exchange@192.168.0.2 < %TEMP%\sftpscri.pt | |
REM Delete the sftpscript | |
del /Q %TEMP%\sftpscri.pt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM Usage: | |
REM 1. Set up your DOS network and packet drivers | |
REM 2. Install sftpd386.exe | |
REM 3. Edit the line which calls sftpd386.exe for path/credentials/IP address | |
REM 4. Run "sftpsend file1 file2 file3 ..." | |
REM Write sftp script | |
( | |
@echo off | |
echo cd writable | |
FOR %%A in (%*) DO echo put %A | |
echo bye | |
) > %TEMP%\sftpscri.pt | |
REM Pipe it as input because -b doesn't seem to get along with -i | |
c:\apps\ssh2\sftpd386.exe -i c:\apps\ssh2\id_rsa nostalgia-exchange@192.168.0.2 < %TEMP%\sftpscri.pt | |
REM Delete the sftpscript | |
del /Q %TEMP%\sftpscri.pt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment