Skip to content


File-Transfer with SCP

Copying file to host:

scp SourceFile user@host:~/TargetFile

Copying file from host and copying folder from host (with -r switch):

scp user@host:~/remotefolder .
scp -r user@host:~/remotefolder TargetFolder

Note that if the remote host uses a port other than the default of 22, it can be specified in the command. For example, copying a file from host:

scp -P 666 user@host:directory/SourceFile TargetFile


What Where
Official Page

Connect OneDrive over WebDAV

  • After you log in to your OneDrive account, your URL should be like: The ABCDEFGHIJKLMNOP part is your "customer ID". Select it and copy it to the clipboard.
  • Start WinSCP and create a new Login/New site node
  • On the New site node, select WebDAV protocol and TLS/SSL Implicit encryption.
  • Enter into the Host name box.
  • Enter your Microsoft account credentials. If you have 2FA enabled, create new app password and use this for the password box.
  • Press the Advanced button to open Advanced site settings dialog and go to Environment > Directories page.
  • Paste your "OneDrive customer ID" into the Remote directory box and add a slash in front of it, i.e. like /ABCDEFGHIJKLMNOP.


In a commmand prompt run and login to a session. It is also possible to pass on all commands directly or attach a script with all commands.

Basic Example:

Save this script to a file (e.g. WinSCPWebDAVExample.txt)

put copythisfile.txt /path/destination/

Run the scirpt with WinSCP like this: /script=WinSCPWebDAVExample.txt

You can also run this example as a one-liner as follows: /command "open" "put copythisfile.txt /path/destination/" "exit"

My settings

I trigger in a batch file as follows:

@echo off /rawconfig Interface\SynchronizeParams=4096 /ini=nul /script=myscript.txt

My example script file to upload to a WebDAV server:

# Connect to WebDAV server using a password
open davs://

# Settings
option batch on
option confirm off

# Set local dir
lcd "L:\o\c\a\l"

# Set remote dir
cd "/www"

# Sync Files
synchronize remote -delete -mirror "L:\o\c\a\l" "/remote/"

# Exit WinSCP
Back to top