« Fix for Windows in MB… | Home | Matrix functions for … »

Run fmsadmin from script

On your server you may need to run fmsadmin to query or change a setting from FileMaker Server. You can do that with Shell functions in MBS FileMaker Plugin. Just run fmsadmin.exe with various parameters and read standard / error output. For Windows, please pass the full path of the exe file as there is no cmd.exe running to lookup shell variable PATH to find the applicaiton for you.

Here is a little script to query version and pass the credentials:

Set Variable [ $shell ; Value: MBS( "Shell.New" ) ] 

Set Variable [ $s ; Value: MBS( "Shell.Execute"; $shell; "C:\Program Files\FileMaker\FileMaker Server\Database Server\fmsadmin.exe"; "-v"; "-u"; "admin"; "-p"; "xxx") ] 

If [ MBS("IsError") ] 

Show Custom Dialog [ "Failed to run" ; $s ] 


# Loop while app runs and collect messages

Set Variable [ $s ; Value: MBS( "Shell.Wait"; $shell; 5) ] 

Set Variable [ $result ; Value: MBS( "Shell.ReadOutputText"; $shell; "UTF-8") ] 

Show Custom Dialog [ "Result" ; $result ] 

End If


Set Variable [ $r ; Value: MBS("Shell.Release"; $shell) ] 

For MacOS or Linux, you may need a different path for fmsadmin command line tool.

Claris FileMaker Plugin
28 05 19 - 07:55