Differences
This shows you the differences between the selected revisions of the page.
| 2023-01-11 | 2023-02-28 (current) | ||
| no summary (39.50.255.15) | recommend logging (martin) | ||
| Line 35: | Line 35: | ||
| Assemble the commands into a script file. You can name the script file as you like. See [[scripting#example|simple example]] and some [[scripts|useful scripts]]. | Assemble the commands into a script file. You can name the script file as you like. See [[scripting#example|simple example]] and some [[scripts|useful scripts]]. | ||
| - | Use the ''/script'' [[commandline#scripting|command line]] option to pass the script to the WinSCP [[executables|executable]]. Generally, you should also use ''[[commandline#configuration|/ini=nul]]'' switch to [[scripting#configuration|isolate the script execution from GUI configuration]]. You can embed the complete command line into a Windows batch file (''.bat''), like as follows: | + | Use the ''/script'' [[commandline#scripting|command line]] option to pass the script to the WinSCP [[executables|executable]]. Generally, you should also use [[commandline#configuration|''/ini=nul'' switch]] to [[scripting#configuration|isolate the script execution from GUI configuration]] and [[commandline#logging|''/log='' switch]] to enable [[logging|session logging]]. You can embed the complete command line into a Windows batch file (''.bat''), like as follows: |
| <code batch> | <code batch> | ||
| @echo off | @echo off | ||
| - | winscp.com /ini=nul /script=myscript.txt | + | winscp.com /ini=nul /log=myscript.log /script=myscript.txt |
| </code> | </code> | ||
| Line 85: | Line 85: | ||
| <code batch> | <code batch> | ||
| - | winscp.com /ini=nul /script=script.tmp /parameter // c:\myfile.txt | + | winscp.com /ini=nul /log=script.log /script=script.tmp /parameter // c:\myfile.txt |
| </code> | </code> | ||
| Line 103: | Line 103: | ||
| rem Execute the script | rem Execute the script | ||
| - | winscp.com /ini=nul /script=script.tmp | + | winscp.com /ini=nul /log=script.log /script=script.tmp |
| rem Delete the temporary script | rem Delete the temporary script | ||