Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3316 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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. 

Posted

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'?

Posted

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.

Posted (edited)

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
Posted

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.

Posted

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? 

Posted

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

This topic is 3316 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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