Skip to main content

We don't have FME Server but we need for to be able to call a workbench to run remotely from machines that may not have FME Desktop installed.

I've been playing with WMI as below. It successfully calls notepad and arcgis pro however fme.exe will startup but disappear from the process list before the workbench executes. If i copy/paste my cmdline onto the servers command prompt the workbench executes fine.

import wmi
import os

SW_SHOWMINIMIZED = 1
server = 'DC3FMEDESKTOP'
username = r'TFS' + os.sep + 'richardw-admin'
print username
password = 'password'

c = wmi.WMI(server,user=username,password=password)
startup = c.Win32_ProcessStartup.new (ShowWindow=SW_SHOWMINIMIZED)
cmdline = "fme.exe S:\GIS\ESRIData\Scripts\FME\Server\\testremote.fmw \
       --SourceDataset_FILEGDB \"S:\GIS\ESRIData\Authoritative\Climate_and_Environment\Meteorology.gdb\""
#cmdline = "fme.exe"
#cmdline = "C:\Program Files\ArcGIS\Pro\\bin\ArcGISPro.exe"
print cmdline
# pid, result = c.Win32_Process.Create (
#   CommandLine="notepad.exe",
#   ProcessStartupInformation=startup
# )
pid, result = c.Win32_Process.Create (
  CommandLine=cmdline,
  ProcessStartupInformation=startup
)
print pid

Hi @tfsrichard,

There seems to be a carriage return in the command line you are using to run FME. Please remove this and try again.

The command line is shown in the workspace and log file with carriage returns for clarity, but these should be removed when using the command.


Thanks Dave,

I remove carriage returns to no avail. Still creating a PID but the process rapidly disappears. 

fme.exe S:\GIS\ESRIData\Scripts\FME\Server\testremote.fmw --SourceDataset_FILEGDB S:\GIS\ESRIData\Authoritative\Climate_and_Environment\Meteorology.gdb

Can you capture the response from your command line at all? This may give us more information on what is failing.

It may be that fme.exe cannot be found in the Path, or that it is failing to start properly.


Can you capture the response from your command line at all? This may give us more information on what is failing.

It may be that fme.exe cannot be found in the Path, or that it is failing to start properly.

Thanks Dave, it turns out it was a problem with network access to unc or shares. Using local resources fme is called fine via wmi.

 

 


Reply