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