Check For File
I have found a ton of posts that instruct you how to check for the existence of a file, but every example I have found is for using WinSCP.com - I have yet to find an example that demonstrates how to use WinSCP.exe and how to check for a file with a mask.
Is there someplace I can find an example of this?
This is my current script:
SET REMOTE_PATH = /out/extract_CES_SAE_v3_p0019478fq5n*.txt.pgp
open sftp://p00xxxxxxxxxxxxxx@st.concursolutions.com/ -hostkey="ssh-rsa 2048 wbxxxxxxxxxxxxxxxxxxxxxxxxxxx="
option failonnomatch on
ls %REMOTE_PATH%
#lcd "C:\Concur Files\Incoming\Daily SAE File"
#get -resumesupport=off -delete "./out/extract_CES_SAE_v3_p0019478fq5n*.txt.pgp"
# Your command 2
exit
if %ERRORLEVEL% neq 0 goto error
echo file %REMOTE_PATH% exists
lcd "C:\Concur Files\Incoming\Daily SAE File"
get -resumesupport=off -delete "./out/extract_CES_SAE_v3_p0019478fq5n*.txt.pgp"
exit /b 0
:error
echo ERROR or file %REOMTE_PATH% not exists
exit /b1
# Execute the script using a command like:
# "C:\Program Files (x86)\WinSCP\WinSCP.exe" /log="C:\writable\path\to\log\WinSCP.log" /ini=nul /script="C:\path\to\script\script.txt"
Any help would be appreciated...
Is there someplace I can find an example of this?
This is my current script:
SET REMOTE_PATH = /out/extract_CES_SAE_v3_p0019478fq5n*.txt.pgp
open sftp://p00xxxxxxxxxxxxxx@st.concursolutions.com/ -hostkey="ssh-rsa 2048 wbxxxxxxxxxxxxxxxxxxxxxxxxxxx="
option failonnomatch on
ls %REMOTE_PATH%
#lcd "C:\Concur Files\Incoming\Daily SAE File"
#get -resumesupport=off -delete "./out/extract_CES_SAE_v3_p0019478fq5n*.txt.pgp"
# Your command 2
exit
if %ERRORLEVEL% neq 0 goto error
echo file %REMOTE_PATH% exists
lcd "C:\Concur Files\Incoming\Daily SAE File"
get -resumesupport=off -delete "./out/extract_CES_SAE_v3_p0019478fq5n*.txt.pgp"
exit /b 0
:error
echo ERROR or file %REOMTE_PATH% not exists
exit /b1
# Execute the script using a command like:
# "C:\Program Files (x86)\WinSCP\WinSCP.exe" /log="C:\writable\path\to\log\WinSCP.log" /ini=nul /script="C:\path\to\script\script.txt"
Any help would be appreciated...