Skip to main content
Best Answer

Pass a different source and destination parameter (file path) in Bat file

  • March 20, 2020
  • 3 replies
  • 139 views

ksafeent

Hi, Anyone knows how to pass a different file path (parameter) in Batch File?

I am calling my fmw in a batch file however I cannot change my source and destination path.

Best answer by ryanatsafe

Make sure that the source and destination parameters are published parameters. Then use the published parameter names as flags in the batch file. It'll look something like this:

fme myworkspace.fmw --SourceDataset_ESRISHAPE "c:\\data\\parks.shp" --DestDataset_ESRISHAPE "C:\\SHP\\output.shp"

 

You can find an example of the command line entry to use at the top of the log file when you run the workspace in Workbench.

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.

3 replies

ryanatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • Best Answer
  • March 20, 2020

Make sure that the source and destination parameters are published parameters. Then use the published parameter names as flags in the batch file. It'll look something like this:

fme myworkspace.fmw --SourceDataset_ESRISHAPE "c:\\data\\parks.shp" --DestDataset_ESRISHAPE "C:\\SHP\\output.shp"

 

You can find an example of the command line entry to use at the top of the log file when you run the workspace in Workbench.


ksafeent
  • Author
  • March 20, 2020

Make sure that the source and destination parameters are published parameters. Then use the published parameter names as flags in the batch file. It'll look something like this:

fme myworkspace.fmw --SourceDataset_ESRISHAPE "c:\\data\\parks.shp" --DestDataset_ESRISHAPE "C:\\SHP\\output.shp"

 

You can find an example of the command line entry to use at the top of the log file when you run the workspace in Workbench.

Thanks @ryanatsafe. I was actually using the command line from the log. with below syntax on my bat file

 

C:\\apps\\FME\\fme.exe E:\\500-GIS\\01-ESRI\\AverageDepth.fmw

--SourceDataset_FILEGDB "E:\\500-GIS\\01-ESRI\\Created_Shapefiles\\Sewer2018.gdb"

--DestDataset_FILEGDB "E:\\500-GIS\\01-ESRI\\Created_Shapefiles\\Sewer2018.gdb"

 

However when I change my source&dest file path the output still writes on my original file path (path provided inside my fme)

 

 

 


ryanatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • March 20, 2020

Thanks @ryanatsafe. I was actually using the command line from the log. with below syntax on my bat file

 

C:\\apps\\FME\\fme.exe E:\\500-GIS\\01-ESRI\\AverageDepth.fmw

--SourceDataset_FILEGDB "E:\\500-GIS\\01-ESRI\\Created_Shapefiles\\Sewer2018.gdb"

--DestDataset_FILEGDB "E:\\500-GIS\\01-ESRI\\Created_Shapefiles\\Sewer2018.gdb"

 

However when I change my source&dest file path the output still writes on my original file path (path provided inside my fme)

 

 

 

Make sure the --SourceDataset_FILEGDB and --DestDataset_FILEGDB are on the same line as the C:\\apps\\FME\\fme.exe E:\\500-GIS\\01-ESRI\\AverageDepth.fmw. The log file has line-breaks to clean up the formatting, but in the actual command it all has to be on the same line. Because the flags are optional, if they are on a separate line then the FMW file will use the default values.

 

Another issue to be aware of is that FME can only create so many folders when it is running a translation. It should be able to handle what you have set, but double check to see if the folder Created_Shapefiles already exists. If not, create it manually.