October 17, 201510 yr 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?
October 17, 201510 yr 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.
October 19, 201510 yr 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'?
October 19, 201510 yr 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.
October 19, 201510 yr 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 October 19, 201510 yr by Simplidata typos
October 19, 201510 yr 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.
October 19, 201510 yr 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?
October 20, 201510 yr 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
October 25, 201510 yr This may or may not; depending on what your .bat file does, be a better way to solve your case: http://wethecomputerabusersamongst.blogspot.com/2013/10/execute-php-script-from-filemaker-with.html
Create an account or sign in to comment