Skip to main content
Question

FME batch file works but not via Windows Task Scheduler

  • April 5, 2018
  • 2 replies
  • 497 views

Forum|alt.badge.img+4

@david_r 

@DanAtSafe 

I've created a simple workspace to download a file from FTP every morning. 

  • When I run the workspace in FME -> everything works.
  • When I run the FME workspace from the command line -> everything works.
  • When I run the batch file that I created, which points to the FME workspace -> everything works.
  • When I create a task in Windows Task Scheduler to run the batch file that I created, which points to the FME workspace -> Task Scheduler says it completes successfully, but no files are downloaded or saved.

Additionally, I added a function (at the end of the batch file that launches the FME workspace), in order to create a simple log file called "batch_log.txt":

C:\apps\FME_18440_x64\fme.exe "J:\workspace.fmw" echo "this works" > C:\apps\Scratch\batch_log.txt

When I run the batch file from the CMD prompt successfully (not Task Scheduler), the log file contains this:

FME 2018.1.0.0 Beta (20180319 - Build 18440 - WIN64)
FME ESRI Edition (node locked-crc)
Permanent License.
Machine host name is: XXXXXXXXXX
Operating System: Microsoft Windows 7 64-bit Service Pack 1 (Build 7601)
Copyright (c) 1994 - 2018, Safe Software Inc.
Safe Software Inc.

Reading...
Emptying factory pipeline...

When I run the batch file from Task Scheduler (unsuccessfully), the log file contains this:

FME 2018.1.0.0 Beta (20180319 - Build 18440 - WIN64)
FME ESRI Edition (node locked-crc)
Permanent License.
Machine host name is: XXXXXXXXXX
Operating System: Microsoft Windows 7 64-bit Service Pack 1 (Build 7601)
Copyright (c) 1994 - 2018, Safe Software Inc.
Safe Software Inc.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

fmelizard
Safer
Forum|alt.badge.img+20
  • Safer
  • 3719 replies
  • April 5, 2018

Suggest using LOG_FILENAME c:\\temp\\mylog.txt on your command line instead of just redirecting standard output. Then examining the contents of those more complete logs should provide additional insights.


I had exactly the same problem with my batch file - Fixed by ensuring that the account you are using to run the script in Task Scheduler has Full Control permissions on the folder containing the script, the script itself, and any folders/files that the script touches when it runs. Previously my batch file was in a dropbox location - relocated to C:drive and it work worked perfectly.