Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want a windows scheduled task to execute an ftp batch file which will upload some files to my server. If i run the argument below from the command line then it executes successfully.

ftp -i -s:C:\<path-to-file>\ftp.dat

When i try and run this through a scheduled task it always gets to Created task Process and stays like this, it does not complete or fail. I have also tried this without the put commands and it still does it so its not as if it is waiting to transfer the files.

I am creating the task through the task scheduler GUI on vista. Under the general tab i have run whether user is logged on or not and run with highest privileges set.

Under actions it is set to run C:\Windows\System32\cmd.exe

And the argument is

ftp -i -s:C:\<path-to-file>\ftp.dat

The ftp.dat file looks like this:

open ftp.mysite.co.uk
myUsername
myPassword
put C:\<path-to-file>\file.xml
put C:\<path-to-file>\file2.xml
bye

I dont understand why this runs perfectly fine manually from the command line but not from the scheduled task

share|improve this question
add comment

1 Answer

My suggestion would be run a vbscript a scheduled task

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "C:\Windows\System32\ftp.exe -i -s:C:\\ftp.dat", , True

I've always had much more luck with scheduling vbscripts over trying to scheduled commands

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.