locked
Task Scheduler ftp script bat RRS feed

  • Question

  • Hi, I am using Windows Server 2008 R2. I have created a bat file and a script. The bat file contains: > ftp -s:script.sct and the script contains all the required information. It all works perfectly when I run the bat myself (by clicking on it). But when I create a task scheduler and run it it doesn't work. The task runs and it says "Task completed successfully", but there is no output (the files are not created/updated). I have specified a local administrator to run the job, and I have checked "Run with highest privileges". What can I do? The task runs successfully but it doesn't write to the disk.
    Tuesday, September 21, 2010 6:51 AM

Answers

  • Apparently because cmd is located in c:\system32\ it places the downloaded files there.

    So I just added in the script: lcd c:\myfolder

    and now it works fine.

    • Marked as answer by Astrit Ramadani Wednesday, September 22, 2010 7:13 AM
    Wednesday, September 22, 2010 7:13 AM

All replies

  • Apparently because cmd is located in c:\system32\ it places the downloaded files there.

    So I just added in the script: lcd c:\myfolder

    and now it works fine.

    • Marked as answer by Astrit Ramadani Wednesday, September 22, 2010 7:13 AM
    Wednesday, September 22, 2010 7:13 AM
  • Hi,

    We have exactly the same problem, however our script is configured to put files in an alternate folder.

    What exactly do you mean with "cmd is located in c:\system32". Do you mean the cmd-command or do you mean your own command which is starting the script.

    Eric

    Monday, November 22, 2010 2:55 PM
  • Sorry my fault, We also have a lcd c:\myfolder in script.

    Still the script doesn't work on scheduler. Probably a rights issue

    Monday, November 22, 2010 3:31 PM
  • Finaly found the solution.

    You need to specify "Start in (optional):" value in propererties of your scheduled task.

    • Rightclick scheduled task
    • Click properties
    • Click Actions-tab
    • Edit "Start a program"-action
    • Specify "Start in (optional):" - parameter (for example C:\myfolder)
    • Click OK to close "Edit Action"-window
    • Click OK to close task-properties-window
    • Re-enter the user account information for running this task

     

    Monday, November 22, 2010 3:51 PM
  • I have the same issue. except that when specify a "start in" parameter, It says "the directory name is invalid".

    This is a mapped drive with the letter P:\ could that be the problem ?

    Thanks,

    Paras

    Friday, October 10, 2014 4:58 PM