You cannot use any string processing syntax.Note that variable expansion is different than in Windows batch files: You can use environment variables in the commands, with syntax %NAME%: 1 put " %FILE_TO_UPLOAD%" The log will show how WinSCP understands both your command-line and individual scripting commands. To debug the quoting, enable session logging on level Debug 1 ( /loglevel=1). Note that when you are specifying commands on command-line using /command, you need to surround each command by double-quote and escape the in-command double-quotes by doubling them. Put "file with spaces and " "quotes" ".html" To use double-quote literally, double it: parameternĬommand parameters that include space(s) have to be surrounded by double-quotes. To further analyze results of scripted operations, you will find XML logging useful.įor more details, refer to How do I know that script completed successfully? Commands SyntaxĬommand -switch -switch2 parameter1 parameter2. WinSCP executables return exit code 1 when any command is interrupted due to an error or any prompt is answered Abort (even automatically in batch mode). Note that the first connection to an SSH server requires verification of the host key.Īlso the first connection to FTPS or WebDAVS host with certificate signed by untrusted authority requires verification of the certificate. Use the session command to switch between them. Multiple sessions can be opened simultaneously. For batch mode it is recommended to turn off confirmations using option confirm off to allow overwrites (otherwise the overwrite confirmation prompt would be answered negatively, making overwrites impossible). To force batch mode (all prompts are automatically answered negatively) use the command option batch abort. In an interactive scripting mode, the user is prompted in the same way as in GUI mode. When running commands specified using /script or /command, batch mode is used implicitly and overwrite confirmations are turned off. The script file must use UTF-8 or UTF-16 (with BOM) encoding. For details see console/scripting command-line parameters.įor automation, commands can be read from a script file specified by /script switch, passed from the command-line using the /command switch, or read from standard input of. NET AssemblyĮnter the console/scripting mode by using or /console command-line parameter with winscp.exe. Sharing Configuration with Graphical Mode.Running a Script under a Different Account (e.g., Using a Scheduler).Verifying the Host Key or Certificate in Script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |