Question

FME batch file works but not via Windows Task Scheduler

  • 5 April 2018
  • 2 replies
  • 45 views

Badge +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.

2 replies

Userlevel 4
Badge +13

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.

Reply