-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsftp.bat
43 lines (39 loc) · 845 Bytes
/
sftp.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@echo off
call config
if [%1] == [] (
echo Missing destination. Use /? for help.
goto:eof
)
if "%1" == "/?" (
echo Usage: sftp profileName^|[email protected] ["server commands"]
echo.
echo SFTP using the Bitvice SFTP Client.
goto:eof
)
:: http://www.bitvise.com/tunnelier#sftpc
if [%2] == [] (
set cmd=
) else (
set cmd=-cmd=%2
)
set profile_bscp=%term_path%\%1.bscp
set profile_tlp=%term_path%\%1.tlp
echo.
if exist "%profile_bscp%" (
echo Connecting with profile %1.bscp ...
echo.
sftpc -profile="%profile_bscp%" %cmd%
goto:eof
) else (
if exist "%profile_tlp%" (
echo Connecting with profile %1.tlp ...
echo.
sftpc -profile="%profile_tlp%" %cmd%
goto:eof
) else (
echo Connecting to %1 ...
echo.
sftpc %*
goto:eof
)
)