The connection is naturally closed with WinSCP, so you need to reopen it each time.
Martin, This batch script works but when I break it down to more than 1 command block I can't get it to work. If I can sort this out then the error reporting can be much better.
set cmdopen=open tester
set cmdbatchon=option batch on
set cmdconfirmoff=option confirm off
set cmdgetaudio=get /uploads/*.DSS /uploads/*.dss /uploads/*.WAV /uploads/*.wav /uploads/*.MP3 /uploads/*.mp3 C:\QSDU\Uploads\*.*
set cmdmvaudio=mv /uploads/*.DSS /uploads/*.dss /uploads/*.WAV /uploads/*.wav /uploads/*.MP3 /uploads/*.mp3 /uploads/wsArchive/*.*
set cmdgetinc=get /incomplete_reports/*.doc C:\QSDU\incomplete_reports\*.doc
set cmdmvinc=mv /incomplete_reports/*.doc /incomplete_reports/wsArchive/*.doc
set cmdputfiles=put C:\QSDU\temp\*.* /completed_reports/2007/*.*
set logpath="C:\Program Files\WinSCP\ots_scripts\logs\qsdu.log"
echo running winscp commands
winscp.exe /command "%cmdopen%" "%cmdbatchon%" "%cmdconfirmoff%" "%cmdgetaudio%" "%cmdmvaudio%" "%cmdgetinc%" "%cmdmvinc%" "%cmdputfiles%" "exit" /log=%logpath%
if errorlevel 1 goto error1
echo WinSCP commands run successfully ...
echo Error Level 1 Reported
But this doesn't ??
winscp.exe /command "%cmdopen%" /log=%logpath%
winscp.exe session 1 /command "%cmdbatchon%" /log=%logpath%
winscp.exe /command "session 1" "%cmdconfirmoff%" /log=%logpath%
winscp.exe session /command "%cmdgetaudio%" /log=%logpath%
It is not possible to step out of a script.
Thanks, I have made some progress and am using a batchfile in conjunction with a script. Is it possible to step in and out of a single script from a batch file or would I have to use multiple script files if I want / need to go back and forth from the batch file.
There's no logic implemented.
Hi, relatively new to scripting. I have been able to get a basic script working from a batch file but cannot find any information on using some sort of logic within the script. I.e
Any help or examples would be appreciated.