Post a reply

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

richardcav

Script works standalone but not in Windows Task Scheduler?

Hi, newbe here so sorry if this is a stupid question, I have a script that builds a .dat file that gets uploaded by winscp.cmd, the script is...
@echo off
echo open sftp://username@IP/home/domain/public_html/ -hostkey="key" -privatekey="Key" -passphrase=phrase >> ftpcmd.dat
echo put xmlfile.xml >> ftpcmd.dat
echo exit >> ftpcmd.dat
"C:\Program Files (x86)\WinSCP\winscp.com" /script=ftpcmd.dat
del ftpcmd.dat

...and it works perfectly when I execute fileup.bat (the name of the batch file), but when I try to schedule that same batch file, it doesn't work – it runs and stops straight away.

Can anyone please tell me what I'm doing wrong?

Regards
Richard