Hi,
I am writing a below script. Need help to fix quote issue for define path.
If i use below CODE1 everything work fine. But when i use CODE2 unable to get into sub directory path & get error. I try to adjust quote but still same issue.
As you can see ERROR it show single quote before "department" word. If i remove that from CODE2 set it as (set pathname1="Q:\"""Fall 2020\"""Department Stores"") it show error as ( File or folder 'Q:\Fall 2020\Department' does not exist.).
Let me know how can we fix this.
Code1:
@echo off
set pathname0="Q:\"""Fall 2020\""
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\WinSCP.log" /ini=nul ^
/command ^
"open sftp://***/ -hostkey=""ssh-*****="" -rawsettings FSProtocol=2" ^
"cd /BIDATA/Testfolder" ^
"put -filemask="*.xlsx" %pathname0%" ^
"exit" ^
Code2:
@echo off
set pathname1="Q:\"""Fall 2020\""""Department Stores""
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\WinSCP.log" /ini=nul ^
/command ^
"open sftp://*********/ -hostkey=""ssh-****"" -rawsettings FSProtocol=2" ^
"cd /BIDATA/Testfolder/" ^
"put %pathname1%" ^
"exit"^
Error:
Active session: [1] BITEAM@******
/BIDATA/Testfolder
File or folder 'Q:\Fall 2020\"Department Stores' does not exist.
System Error. Code: 2.
The system cannot find the file specified
(A)bort, (R)etry, (S)kip, Ski(p) all: Abort
Thanks