Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Can you help with the syntax please?

The connection is naturally closed with WinSCP, so you need to reopen it each time.
david@ots.net.au

Can you help with the syntax please?

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.

This Works
____________________________________________________
@echo off
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 ...
pause
exit
:error1
echo Error Level 1 Reported
pause
exit__________________________________________________________________

But this doesn't ??

winscp.exe /command "%cmdopen%" /log=%logpath%
winscp.exe session 1 /command "%cmdbatchon%" /log=%logpath%
or
winscp.exe /command "session 1" "%cmdconfirmoff%" /log=%logpath%
or
winscp.exe session /command "%cmdgetaudio%" /log=%logpath%

etc...

Thanks
martin

Re: Logic

It is not possible to step out of a script.
david@ots.net.au

Logic

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.
martin

Re: logic in scripts

There's no logic implemented.
david@ots.net.au

logic in scripts

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

result=open session
IF(NOT(ISEQUAL(result,"OK")))
CALL(blat_cmd_line1)
SLEEP(5)
EXIT(1)
END IF

Any help or examples would be appreciated.