If file exists
Hi
I use a batch file to call winscp.
What I'm trying to do is send a parameter from the bat file to winscp and check that the file has been correctly uploaded.
So here's what my bat file looks like,beside the point is that the bat file is called from SQL server.
REM Batfile
winscp.com /console /script=Web_Test1.txt /parameter %1% /log=c:\WinScp.log
IF %ERRORLEVEL% neq 0 goto error
ECHO Success> c:\sucess_%1%.txt
EXIT /b 0
: ERROR
ECHO Error> c:\error_%1%.txt
EXIT /b 1
_______________________________________________________________
This is how the scipt file looks like Web_Test1.txt
option batch abortion
option confirm off
open ftp: // username: password@remotesite.com
option transfer binary
put c:\%1%
state %1%
exit
#Would above be all that is needed or should I add below:
IF% ERRORLEVEL% neq 0 goto error
exit
error
ECHO Error> c: \ error_% 1% .txt
exit
#Comment End
I use a batch file to call winscp.
What I'm trying to do is send a parameter from the bat file to winscp and check that the file has been correctly uploaded.
So here's what my bat file looks like,beside the point is that the bat file is called from SQL server.
REM Batfile
winscp.com /console /script=Web_Test1.txt /parameter %1% /log=c:\WinScp.log
IF %ERRORLEVEL% neq 0 goto error
ECHO Success> c:\sucess_%1%.txt
EXIT /b 0
: ERROR
ECHO Error> c:\error_%1%.txt
EXIT /b 1
_______________________________________________________________
This is how the scipt file looks like Web_Test1.txt
option batch abortion
option confirm off
open ftp: // username: password@remotesite.com
option transfer binary
put c:\%1%
state %1%
exit
#Would above be all that is needed or should I add below:
IF% ERRORLEVEL% neq 0 goto error
exit
error
ECHO Error> c: \ error_% 1% .txt
exit
#Comment End