Re: How to take a path including special char like (C:\WIN & SCP\Audit\)
This is rather a batch file question, than a WinSCP question.
The only WinSCP-specific part of this is doubling of double-quotes, but you you seem to be aware of that:
https://winscp.net/eng/docs/commandline#syntax
Regarding the batch-file-part: If you pass
You want this:
And as
Also the batch file syntax for parameters is
Last, you seem to have the indentation wrong:
https://winscp.net/eng/docs/faq_batch_file#newline_escaping
The only WinSCP-specific part of this is doubling of double-quotes, but you you seem to be aware of that:
https://winscp.net/eng/docs/commandline#syntax
Regarding the batch-file-part: If you pass
"%Localpath%"
as a 4th parameter of a batch file, the %4
will contain those quotes. So you have to cater for that in your other batch file.
You want this:
"lcd ""C:\WIN & SCP\Audit\""" ^
And as
%4
contains one pair of double-quotes already, you need to use:
"lcd "%4"" ^
Also the batch file syntax for parameters is
%N
, while you inconsistently sometimes have incorrectly %N%
and sometimes correctly %N
.
Last, you seem to have the indentation wrong:
https://winscp.net/eng/docs/faq_batch_file#newline_escaping