Skip to content

Instantly share code, notes, and snippets.

@NorihikoMoriyama
Last active December 22, 2015 23:39
Show Gist options
  • Save NorihikoMoriyama/6548249 to your computer and use it in GitHub Desktop.
Save NorihikoMoriyama/6548249 to your computer and use it in GitHub Desktop.
リモート・マシン間でファイルをコピーする
cd C:\Program Files\WinSCP
winscp.exe /console /script=C:\Users\***\winscp_fileup.txt
del C:\Users\***\images\*.jpg
# バッチモードに設定し、確認/問い合わせを無効にする
option batch on
# ファイル上書きの確認などを無効にする
option confirm off
# サーバーに接続
open [user]:[password]@[ip]
# リモートディレクトリを変更
cd /var/www/html/***/images
# バイナリモードに変更
option transfer binary
# ファイルをアップロード
put C:\Users\***\images\*.jpg
# ファイルをダウンロード
#get *.jpg C:\Users\***\images\
# 切断
close
# 終了
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment