Skip to main content

Hi All!

I’m new to FME and have (hopefully) a simple question. I have created a workspace that reprojects data from one projection to another in ESRI Geodatabase (sde). I have embedded the connection parameters. The workspace successfully runs. 

I have created a batch file, using the command prompt information from the result of the translation log. The batch file successfully runs when executed manually. 

When I schedule via Task Scheduler, its fails (0x1). Return code 2147942401

The user account that runs the task is my own username. On local PC. Runs with highest privileges set. Under Action, it points to the location of the batch file. 

 

What am I missing?

Thanks,

Leanne

This is not likely an FME reason, but rather a Windows issue.

Having similarly run a lot of BAT in task scheduler, there are a few traps, mostly to do with authentication and security when task scheduler tries to execute a command when the user is not logged in.

First create a Test.BAT that creates some file output like:

Echo “Hello World!” » C:\Temp\Test.txt

... And check this runs from Windows.  Then load this as a Task Scheduler task to be the test routine, and check can run this also through manual run of the Task.

 

Now for executing on a Schedule, most commonly users will have to set this to run when not logged in, with most Windows configured to auto log out for security reasons after a period of time off no user inputs.

 

This requires your user name and password to be set in Task Scheduler in this mode but they are some “gotchas” that I’ve run into.

 

First is that the User Name in a corporate environment needs to be DOMAIN NAME\USER NAME format.  Just user name alone won't work.

 

Second, in a corporate environment, the Group Policy Object (GPO) needs to have been set to allow your user account to execute tasks when not logged in, increasingly this is often being locked down by GPO Admins for security reasons.


I agree with you in that I think this is a windows issue. 

 

Unfortunately I can’t get the suggestion above to work. It runs in windows but not when I schedule via Task Scheduler. 

Task Scheduler successfully completed task "\Test" , instance "{970dc0d0-5bc7-4d06-97ca-bf0a6c78510a}" , action "C:\WINDOWS\SYSTEM32\cmd.exe" with return code 2147942401.

 

In my original task, the task uses my username in the format of domain name\user name. Runs whether user is logged on or not, with highest privileges. 

 

 


Unfortunately I can’t get the suggestion above to work. It runs in windows but not when I schedule via Task Scheduler. 

Task Scheduler successfully completed task "\Test" , instance "{970dc0d0-5bc7-4d06-97ca-bf0a6c78510a}" , action "C:\WINDOWS\SYSTEM32\cmd.exe" with return code 2147942401.

 

In my original task, the task uses my username in the format of domain name\user name. Runs whether user is logged on or not, with highest privileges. 

 

Need to clear up which task referring. Was this the Test.BAT that simply piped some text to a file? Like:
echo "Hello World!" >> c:\temp\testwrite.txt

Was this a manual Task run like this?


 

 


Possible is:

  • Workbench without published params
  • Start fme.exe direct:
    Program: c:\programs...\fme.exe
    Param: your_fmw_file_with_path.fmw

Possible is:

  • Workbench without published params
  • Start fme.exe direct:
    Program: c:\programs...\fme.exe
    Param: your_fmw_file_with_path.fmw

The workbench has been published with parameters. My batch file looks like this:

"C:\Program Files\FME\fme.exe" G:\GIS\common\FME\Workbenches\Forestree\Reproject_Forestree_Trees_2.fmw /paramfile "G:\GIS\common\FME\Workbenches\Forestree\params.fmp"


Unfortunately I can’t get the suggestion above to work. It runs in windows but not when I schedule via Task Scheduler. 

Task Scheduler successfully completed task "\Test" , instance "{970dc0d0-5bc7-4d06-97ca-bf0a6c78510a}" , action "C:\WINDOWS\SYSTEM32\cmd.exe" with return code 2147942401.

 

In my original task, the task uses my username in the format of domain name\user name. Runs whether user is logged on or not, with highest privileges. 

 

Need to clear up which task referring. Was this the Test.BAT that simply piped some text to a file? Like:
echo "Hello World!" >> c:\temp\testwrite.txt

Was this a manual Task run like this?


 

 

Yes, this was the Test.bat. And it was run in Task Scheduler by right-clicking on the task > Run


Yes, this was the Test.bat. And it was run in Task Scheduler by right-clicking on the task > Run

 

Well that narrows it down:  It definitely isn’t an FME issue if can’t run a simple Echo to output file BAT command through Task Scheduler.

Note that a manual run shouldn’t need the User Name/Password to be set for testing.

 

 


Reply