Issue with using Passphrase

Advertisement

Swindellvc
Guest

Issue with using Passphrase

I'm trying to create my first batch script and I'm having issues...that I will deal with one at a time.
My Script looks like this... (I've changed sometimes of security)
@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="P:\TK20FileInfo\WinSCP.log" /ini=nul ^
  /command ^
    "open sftp://cofcit:MayKey@huwey.tk20.com/ -hostkey=""ssh-Classified"" -privatekey=""P:\TK20FileInfo\TK20PRI.ppk""-passphrase=""Music"^
    "lcd T:" ^
    "cd /home/cofcit" ^    
    "put tk20_StudentTranscriptfile.txt" ^
    "put tk20_StudentTestfile.txt" ^
    "put tk20_StudentTablefile.txt" ^
    "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%
The first issues I had is that the file had prompted for the passphrase. .but I saw that I could included it in the open line.
The documentation on the actual syntax didn't include an example so I took a stab at it...it doesn't work.
What is the actual syntax?

The second issue I had. (before I tried to include the passphrase) was after it connected is that the script stopped executing right after "LCD T:"^ and the command window leaves me at a prompt.

Any and all help appreciated.

Victor
Swindellvc@cofc.edu

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum