Skip to main content
Solved

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


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.

View original
Did this help you find an answer to your question?

3 replies

ryanatsafe
Forum|alt.badge.img+2
  • 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
ryanatsafe wrote:

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
Forum|alt.badge.img+2
ksafeent wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings