Differences

This shows you the differences between the selected revisions of the page.

2015-03-25 2015-12-17
checking for existence of any file matching a mask (martin) removing uses of option batch and confirm not needed since 5.6 with release of the next major branch 5.8 (martin)
Line 24: Line 24:
==== [[scripting]] Using WinSCP Scripting ==== ==== [[scripting]] Using WinSCP Scripting ====
-You can use a ''[[scriptcommand_stat|stat]]'' command in ''[[scriptcommand_option|option batch abort]]'' mode to query file attributes. If the file does not exist, the ''stat'' command fails and so does the script. Then, [[scripting#checking_results|test WinSCP exit code]] to determine, if the file exists or not.+You can use a ''[[scriptcommand_stat|stat]]'' command in the (default) ''[[scriptcommand_option|option batch abort]]'' mode to query file attributes. If the file does not exist, the ''stat'' command fails and so does the script. Then, [[scripting#checking_results|test WinSCP exit code]] to determine, if the file exists or not.
<code batch> <code batch>
Line 31: Line 31:
set REMOTE_PATH=/home/user/test.txt set REMOTE_PATH=/home/user/test.txt
winscp.com /command ^ winscp.com /command ^
-    "option batch abort" ^ 
    "open mysession" ^     "open mysession" ^
    "stat %REMOTE_PATH%" ^     "stat %REMOTE_PATH%" ^
Line 52: Line 51:
set REMOTE_PATH=/home/user/*.txt set REMOTE_PATH=/home/user/*.txt
winscp.com /command ^ winscp.com /command ^
-    "option batch abort" ^ 
    "open mysession" ^     "open mysession" ^
    "option failonnomatch on" ^     "option failonnomatch on" ^

Last modified: by martin