Solved

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

  • 20 March 2020
  • 3 replies
  • 12 views

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.

icon

Best answer by ryanatsafe 20 March 2020, 05:52

View original

3 replies

Badge

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.

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)

 

 

 

Badge

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.

Reply