ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Need help writing a script? Have any question about ScriptFTP?
Hello,

I've created a sample Script, which ...
  • 1) polls for input directory and fetches a list of files
  • 2) Loops each file and uploads it to FTP server.
  • 2.1) After each succesfull upload the uploaded file is deleted.

Everything works OK when the script is run from ScriptFTP GUI. When It is however scheduled and run as a (Windows) scheduled task the file deletion doesn't work. The log file contains in this case the following message:

EXEC("del /F /Q \\xxxyyyzzz\fffxxxddd\yyyytttrrr\iiitttggghhh\FTP\20080916153739_00B9920080916153736.flv")
Redirect console error: 5

I can't find the cause. Does anyone know what it the problem?


PS. from ScriptFTP GUI the deletion works OK (the file is deleted), but also in that case the following message is shown.
EXEC("del /F /Q \\xxxyyyzzz\fffxxxddd\yyyytttrrr\iiitttggghhh\FTP\20080916153739_00B9920080916153736.flv")
'\\xxxyyyzzz\fffxxxddd\yyyytttrrr\iiitttggghhh\FTP'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.

BR: Harri
Hi Harri,
EXEC("del /F /Q \\xxxyyyzzz\fffxxxddd\yyyytttrrr\iiitttggghhh\FTP\20080916153739_00B9920080916153736.flv")
Redirect console error: 5
It seems to be a permissions issue. Some questions:
  • Do you run ScriptFTP under a different account when scheduled? See the scheduled task properties to know that.
  • What version of windows are you using?
I've slightly modified ScriptFTP to give a more detailed error instead of just "error number 5". Please, download and install ScriptFTP from the link below and post here the output again:

http://www.scriptftp.com/ScriptFTP_3_0_setup_devel.exe



EXEC("del /F /Q \\xxxyyyzzz\fffxxxddd\yyyytttrrr\iiitttggghhh\FTP\20080916153739_00B9920080916153736.flv")
'\\xxxyyyzzz\fffxxxddd\yyyytttrrr\iiitttggghhh\FTP'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
UNC paths means network paths such as \\computer1\whatever. Try to set the current path to a non-UNC path using LOCALCHDIR() before EXEC(). Then, after EXEC(), you can set it back again to an UNC path.
Hello,

It was a permission issue and working now correctly. (we tried to eliminate this issue already yesterday, but obviously we made some mistake). But anyway the main issue is that it is now fixed. Thank you.

Changing the current path by using LOCALCHDIR before executing the DEL (via EXEC) also eliminated the log message "UNC paths are not supported...".

BR. Harri