Differences

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

2014-10-24 2014-10-24
%TIMESTAMP% is beta (martin) splitting syntax section to subsections (martin)
Line 35: Line 35:
command -switch -switch2 parameter1 parameter2 ... parametern command -switch -switch2 parameter1 parameter2 ... parametern
</code> </code>
 +
 +==== Command Parameters with Spaces ====
Command parameters that include space(s) have to be surrounded by double-quotes. To use double-quote literally, double it: Command parameters that include space(s) have to be surrounded by double-quotes. To use double-quote literally, double it:
Line 40: Line 42:
put "file with spaces and ""quotes"".html" put "file with spaces and ""quotes"".html"
</code> </code>
 +
 +==== Environment Variables ====
You can use environment variables in the commands, with syntax ''%NAME%'' ((Generally do surround reference by double-quotes to cope properly with spaces in its value.)): You can use environment variables in the commands, with syntax ''%NAME%'' ((Generally do surround reference by double-quotes to cope properly with spaces in its value.)):
Line 46: Line 50:
</code> </code>
-WinSCP automatically resolves variable ''%TIMESTAMP%'' to real time with format ''20141024161712''.((Unless the variable is already set in environment when WinSCP is started.))·You can customize the format using syntax ''%TIMESTAMP#format%'' where ''format'' may include ''yyyy'' for year, ''mm'' for month, ''dd'' for day, ''hh'' for hour, ''nn'' for minute and ''ss'' for second. For example ''%TIMESTAMP#yyyy-mm-dd%'' resolves to ''2014-10-24''.((Syntax ''%TIMESTAMP#format%'' is resolved by WinSCP to real time, even if ''%TIMESTAMP%'' variable is already set in environment when WinSCP is started.)) See [[http://docwiki.embarcadero.com/Libraries/XE6/en/System.SysUtils.FormatDateTime|other formats you can use]].·&beta_feature+==== Timestamp ==== 
 + 
 +WinSCP automatically resolves ''%TIMESTAMP%'' to a real time with format ''20141024161712''.((Unless the ''%TIMESTAMP%'' variable is already set in an environment, when WinSCP is started.)) 
 + 
 +You can customize the format using syntax ''%TIMESTAMP#format%'' where ''format'' may include ''yyyy'' for year, ''mm'' for month, ''dd'' for day, ''hh'' for hour, ''nn'' for minute and ''ss'' for second. For example ''%TIMESTAMP#yyyy-mm-dd%'' resolves to ''2014-10-24''.((Syntax ''%TIMESTAMP#format%'' is resolved by WinSCP to a real time, even if ''%TIMESTAMP%'' variable is already set in environment, when WinSCP is started.)) See [[http://docwiki.embarcadero.com/Libraries/XE6/en/System.SysUtils.FormatDateTime|other formats you can use]]. 
 + 
 +&beta_feature 
 + 
 +==== Script Arguments ====
You can reference script arguments (passed on command-line using parameter ''[[commandline#scripting|/parameter]]'') using syntax ''%N%'', where ''N'' is ordinal number of argument ((Generally do surround reference by double-quotes to cope properly with spaces in its value.)): You can reference script arguments (passed on command-line using parameter ''[[commandline#scripting|/parameter]]'') using syntax ''%N%'', where ''N'' is ordinal number of argument ((Generally do surround reference by double-quotes to cope properly with spaces in its value.)):
Line 52: Line 64:
put "%1%" put "%1%"
</code> </code>
 +
 +==== Case Sensitivity of File Names ====
Note that WinSCP treats filenames in case sensitive manner. So even if your server treats filenames in case insensitive manner, make sure you specify case properly((This is important particularly for FTP sessions.)). Note that WinSCP treats filenames in case sensitive manner. So even if your server treats filenames in case insensitive manner, make sure you specify case properly((This is important particularly for FTP sessions.)).
 +
 +==== Comments ====
To insert comments into the script file, start the line with ''#'' (hash): To insert comments into the script file, start the line with ''#'' (hash):

Last modified: by martin