Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I an trying to run a batch file using RunShellScript on Windows Server 2008 R2, FM13 - ScriptMaster 4.4.2. The code is as follows:

RunShellScript(  $Folder_Dossier_Path & "batch.bat"; "true" ; "30" )

The variable is simply the path to the batch file. If I double-click the batch file it works but within the script I get the following error message:

java.lang.RuntimeException:Process was terminated.

Other ScriptMaster functions are all working well and they use the same variable so I know it's OK.

I'm a Mac guy so perhaps I'm missing something?

Are you sure it is the OS version of the path??

  • Author

Yes. I have other parts of the script using the same path without any issues. I first move some files there, including the batch file. Then I need to run the batch file. It tells another application to process the files I moved. 

have you trimmed down the batch file? perhaps there's just something in there that SM doesn't like returning. Does it run if you set the 'wait for result' parameter to 'false'?

  • Author

Yes, I tried both true and false and also increased the timeout to 60. Nothing worked. In the end, I used FileMaker's built-in send event command to trigger the batch file. I don't know why ScriptMaster threw the error but I've given up on it.

Thanks for the responses.

What was the actual value returned for:

$Folder_Dossier_Path & "batch.bat"

  • Author

The full path is: G:\ENTRÉE\2015\Octobre\SNC79085\batch.bat

This is running on a French system (hence, the accents). We have used this same path variable in several other ScriptMaster actions without any issues. For example, the folders "2015\Octobre\SNC79085" are created using the ScriptMaster CreateFolder command. The batch file itself is also created and placed in this folder by ScriptMaster. Yet the RunShellScript won't trigger the batch file. As I said in my previous post, I've solved this by using the Send Event script step. 

Edited by Simplidata
typos

I'm glad you got it figured out with Send Event.

I think the reason it's failing is because RunShellScript is designed to take its input as an actual set of instructions to run, not the path of a file to execute.

If you wanted to pass in the path of a file then it might work to do 'CMD.exe /C <pathToFile>'. Of course, the way you're doing it now works as well.

  • Author

Thanks. That's interesting. From what you're saying, the batch file content itself could be inside the RunShellScript function. No need to actually write the batch file to disk first? 

  • Author

To follow up, thanks for the info about how the RunShellScript works. As it happens, I have to run the script from FileMaker Server and the send event script step doesn't work for fmserver (should have noticed that earlier ;-)

Fortunately, ScriptMaster does. I plugged in my batch file contents and it works great!

Thanks Jesse,

Harold

Harold, thanks for letting me know, that's great news!

  • Author

Hi ggt667,

Thanks for the link. I'll take a look at it.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.