Question

Trigger a .bat file using FME

  • 20 April 2016
  • 4 replies
  • 3 views

Badge +1

Hi,

I would like to create an FME workspace that triggers a .bat file to run. I am not familiar with Python so if there is any simple way this can be done with transformers that would be great.

Thanks for your help.


4 replies

Badge +2

SystemCaller Transformer could help.

Userlevel 2
Badge +12

The SystemCaller transformer can do this.

Badge

Hi @aquamarine,

As both mark_1spatial and erik_jan already mentioned, the SystemCaller is the transformer that will solve this problem for you. Just a little example to help you.

I created a simple bat-script that does create an empty file in the same folder as the bat-file is in. This bat-file is located in C:\temp\FME\. The code in this bat-file is the following:

echo. 2>EmptyFile.txt

Running this bat-file results indeed in the creation of the file 'EmptyFile.txt'.

Now that we know the bat-file is working, it is time to call it from the Workbench. I create a simple Workspace containing only a creator and a SystemCaller and the Workspace is saved in the same folder as the bat-file is. When running the workspace, the 'EmptyFile.txt'  is created as expected.

Watch out. Since now the Bat-file is called from the workspace; the file will be created in the same folder the workspace is in. This doesn't have to be the folder the bat-file is in.

Does this answer solve your question?

0684Q00000ArL7RQAV.jpg

Badge +1

Thanks yes I tried the SystemCaller and that worked. Thanks for all your help :)

Reply