5 Replies Latest reply on Mar 16, 2016 6:53 AM by kylerjphillips

    System-level script FileMaker Server

      I've created a System-level script which in FileMaker Server which runs a batch file - however, for some reason it doesn't seem to be running - it throws back an error message
      2016-03-16 12:19:35.913 +0000   Error      692         FILEMAKER         Schedule"" aborted; system script ".bat" returned non-zero status 4.

      Batch file contents
      xcopy /s /y "C:\Program Files\FileMaker\FileMaker Server\Data\Documents" \\external-location\reporting
      The batch file works fine, when ran manually - running FileMaker Server on Windows Server 2012 R2.
        • 1. Re: System-level script FileMaker Server
          alecgregory

          xcopy Error 4 definition below

          4

          Initialization error occurred. There is not enough memory or disk space, or you entered an invalid drive name or invalid syntax on the command line.

          From the documentation here.

           

          I think the most likely cause is that the external location is not accessible to the script when it is run by FileMaker Server. You may need to add a "net use" command to your batch file. See here for the syntax for that. You can use it for network locations and external drives.

           

          A second possibility is a permissions error. Make sure the account you enter in the FileMaker Server Admin Console schedule assistant has permissions to copy to the location specified in the batch file. The default is Local System, but you may need to change this to an account that has permission to copy to the external location. See below for the schedule assistant where you can specify the account.

           

          schedule_assistant.PNG

          • 2. Re: System-level script FileMaker Server

            Thanks alecgregory

             

            The drive I'm copying to is a network drive on a server which is attached to the domain - our FileMaker Server is in a DMZ connected to the LAN though.

             

            Would the netuse command be used in conjunction with the xcopy - basically to enable the network drive to work in the first place, I needed to enter domain\username and password for the network drive, it now works when I run the batch script manually just not through the admin console, I've tried to specify different user settings by using the current logged on user's info (me) but that then said script missing.

            • 3. Re: System-level script FileMaker Server
              CarlSchwarz

              I suggest that you look at using Robocopy instead for a more robust solution.  It just might fix your permissions issue too

               

              This is the most basic way to use it top copy a directory with logging, mirroring to the destination /MIR, and with resume if network connectivity is lost /Z

              Robocopy "E:\ExampleSourceDirectory" "\\ExternalServer\ExampleDirectory" /MIR /Z /log:"E:\log.txt"

               

              Robocopy - Wikipedia, the free encyclopedia

              • 4. Re: System-level script FileMaker Server
                alecgregory

                You need a net use line in your batch file before the xcopy line. I believe the format should be:

                net use \\external_location\reporting password /USER:username

                xcopy /s /y "C:\Program Files\FileMaker\FileMaker Server\Data\Documents" \\external_location\reporting

                1 of 1 people found this helpful
                • 5. Re: System-level script FileMaker Server

                  This worked a treat - thanks alecgregory, CarlSchwarz

                  net use Z: \\external-location\FileMaker /user:domain\username passwordhere

                  xcopy /s /y "C:\Program Files\FileMaker\FileMaker Server\Data\Documents" "Z:"