Differences

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

2014-10-24 2014-10-24
scripting#arguments and scripting#variables (martin) 5.6.2 Bug 1223: Timestamp variable in scripting. (martin)
Line 106: Line 106:
==== Using WinSCP Scripting ==== ==== Using WinSCP Scripting ====
 +=== [[batch]] Using TIMESTAMP Variable ===
 +//In the latest beta release//, &beta you can use ''[[scripting#timestamp|%TIMESTAMP%]]'' construct to insert a read-time to a script.
 +
 +<code winscp>
 +option batch abort
 +option confirm off
 +open mysession
 +get "/home/user/download.txt" "C:\downloaded\download.txt.%TIMESTAMP#yyyymmddhhnnss%"
 +exit
 +</code>
 +
 +
=== [[batch]] From a Batch File === === [[batch]] From a Batch File ===
In Windows batch file, you may retrieve current time in locale-independent format using command ''[[http://technet.microsoft.com/en-us/library/bb491034.aspx|wmic]] os get LocalDateTime''. You can parse the value using using [[http://en.wikibooks.org/wiki/Windows_Batch_Scripting#String_processing|string processing syntax]]: In Windows batch file, you may retrieve current time in locale-independent format using command ''[[http://technet.microsoft.com/en-us/library/bb491034.aspx|wmic]] os get LocalDateTime''. You can parse the value using using [[http://en.wikibooks.org/wiki/Windows_Batch_Scripting#String_processing|string processing syntax]]:

Last modified: by martin