Menu  Toggle search  [ ![](https://winscp-
static-746341.c.cdn77.org/assets/images/logos/logo.png?v=7032) WinSCP  Free
SFTP, SCP, S3 and FTP client  for  Windows  ](https://winscp.net/)

  * [ Home ](/eng/index.php)
  * [ News ](/eng/news.php)
  * [ Introduction ](/eng/docs/introduction)
  * [ Download ](/eng/download.php)
  * [ Install ](/eng/docs/guide_install)
  * [ Documentation ](/eng/docs/)
  * [ Forum ](/forum/)

Close

Search

Close

[ Documentation ](/eng/docs/start "Documentation") » [ Features
](/eng/docs/feature_index "Features") » [ Scripting ](/eng/docs/scripting
"Scripting") » [ Script Commands ](/eng/docs/scripting#commands "Script
Commands") »

#  get command

[ Downloads ](/eng/docs/task_download) one or more files from remote directory
to local directory.

  * Syntax 
  * Remarks 
  * Examples 
  * Converting to .NET Assembly 

_Advertisement_

##  Syntax

    
    
    get <file> [ [ <file2> ... ] <directory>\[ <newname> ] ]
    

##  Remarks

Downloads one or more files from remote directory to local directory.

If only one parameter is specified, downloads the file to local working
directory. If more parameters are specified, all except the last one specify
set of files to download. Filename can be replaced with [ wildcard
](/eng/docs/file_mask) to select multiple files. To download all files in a
directory, use mask ` * ` .

The last parameter specifies target local directory and optionally [ operation
mask ](/eng/docs/operation_mask) to store file(s) under different name. Target
directory must end with backslash. To download more files to current working
directory use ` .\ ` as the last parameter.

With the [ ` /stdout ` command-line switch ](/eng/docs/commandline#stdout) , `
- ` can be used as a target to stream the contents of downloaded file(s) to
the [ standard output of ` winscp.com ` ](/eng/docs/executables#redirection) .
Streaming is supported with the [ SFTP ](/eng/docs/sftp) and [ FTP
](/eng/docs/ftp) .

When specific file name is used, command fails when the file does not exist.
When wildcard is used, command succeeds, without doing anything, if the
wildcard does not match any file, by default (you can change this using ` [
option failonnomatch on ](/eng/docs/scriptcommand_option#failonnomatch) `
command).

You can have WinSCP [ generate a code template
](/eng/docs/guide_automation#generating) for ` get ` for you.

See also ` [ synchronize ](/eng/docs/scriptcommand_synchronize) ` , if you
need to transfer modified or non-existing files only.

Aliases: ` recv ` , ` mget `

_Advertisement_

Switches:

Switch  |  Description   
---|---  
` -delete ` |  Delete source remote file(s) after a successful transfer.   
` -latest ` |  Download the latest file from the files selected by the ` file ` , ` file2 ` … parameters (typically [ file masks ](/eng/docs/file_mask) ) only.   
` -resume ` |  Automatically resume transfer if possible.  1    
[ SFTP ](/eng/docs/sftp) and [ FTP ](/eng/docs/ftp) protocols only. Cannot be
combined with ` -append ` . Has no effect when streaming ( ` - ` target).  
` -append ` |  Append source file to the end of target file.   
[ SFTP protocol ](/eng/docs/sftp) only. Cannot be combined with ` -resume ` .
Has no effect when streaming ( ` - ` target).  
` -preservetime ` |  Preserve timestamp.   
` -nopreservetime ` |  Do not preserve timestamp.   
` -speed=<kbps> ` |  Limit transfer speed (in KB/s).   
` -transfer=<mode> ` |  ` binary|ascii|automatic `   
[ Transfer mode ](/eng/docs/transfer_mode) : binary, ascii (text), automatic
(by extension).  
` -filemask=<mask> ` |  ` <mask>[;<mask2>...] `   
Sets [ file mask ](/eng/docs/file_mask) .  
` -resumesupport= <state> ` |  ` on|off|<threshold> `   
Configures [ automatic resume/transfer to temporary filename
](/eng/docs/resume#automatic) .  
` -neweronly ` |  Transfer new and updated files only. See also ` [ synchronize ](/eng/docs/scriptcommand_synchronize) ` command.   
` -rawtransfersettings  setting1=value1  setting2=value