Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Example scripts for easily sending/receiving files using the SSH2DOS SFTP client
@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
@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