hello-
so the situation is to check that a file exists first, if it does then continue on to the next steps of the ssis package. if the file does not exist then exit and stop. i used the script from
https://winscp.net/eng/docs/script_checking_file_existence#scripting and when i run it i get an error message...
Script: set REMOTE_PATH=/Home/blahblahblah/CustomContractImport/Import/Importcontract.xlsx
Script: Unknown command 'set'.
Script: Failed
is this set command not right? is there something that was not in the original script that was not correct? this seems like a simple script even for a noob like me but apparently it is not. :( can someone help me?
the scriopt is...
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to SFTP server using a password
open sftp://blipblahbloop:EQFz7I:igL13@transfer.filecheck.com/ -hostkey="ssh-rsa 2048 fc:0f:92:5d:98:d4:77:65:2a:eb:a2:fa:0d:27:0a:7f"
# Upload file
echo off
set REMOTE_PATH=/Home/blahblahblah/CustomContractImport/Import/Importcontract.xlsx
winscp.com /command ^
"open mysession" ^
"stat %REMOTE_PATH%" ^
"exit"
if %ERRORLEVEL% neq 0 goto error
echo File %REMOTE_PATH% exists
exit /b 0
:error
echo Error or file %REMOTE_PATH% not exists
exit /b 1
# Disconnect
close