5 Replies Latest reply on Jun 13, 2013 7:07 PM by MarcDolley

    Taskkill Safe for Clean Shutdown FMP on Windows?

    lkeyes

      Hi...I'm looking for a safe, automated way to cleanly shut down FMP on a user's Windows 7 workstation. I want to run a script or batch file which does something like:

       

      If FileMaker is in the Tasklist

      Taskkill /IM FileMaker* /T

      Endif

       

      where /IM = the image name of FileMaker and any additional processes like web publishing.

      and /T = The main program and any child processes spawned by the main process.

       

      This seems to work OK manually...

       

      Questions:

      1. If a user is on their own workstation and sharing a FMP file on another user's workstation via Network sharing, will this be a problem? (could be a FMGO user too..)

      2. If a user on the "sharing" workstation shuts down, and there are others logged into the database, either from FM desktops or FMGo on their machine is that a problem?

       

      Ideas appreciated. TIA.

       

      --- L FMCommandLine.png

        • 1. Re: Taskkill Safe for Clean Shutdown FMP on Windows?
          wimdecorte

          Begs the question why you want to do this...

           

          But: FM has an ActiveX interface that you can use to close FM gracefully instead of killing it.  Do a search in the FM help for "activeX"

          • 2. Re: Taskkill Safe for Clean Shutdown FMP on Windows?
            lkeyes

            >>>begs the question why you want to tdo this...

             

            Have a "FM robot'" machine gathering data after hours; we want to gracefully shut down and transmit the *.FM12 files elsewhere without corrupting the files.

             

            >>ActiveX 

            Hm...will look into this,  many thanks!

             

            -- L

            • 3. Re: Taskkill Safe for Clean Shutdown FMP on Windows?
              wimdecorte

              Taskkill will leave the files in a dirty state if the files were not closed before you kill the process.

               

              FM's scripting has the ability to close files and exit the application; does that not work for you?

              • 4. Re: Taskkill Safe for Clean Shutdown FMP on Windows?
                lkeyes

                >>dirty state

                That's what I was worried about... so won't pursue that avenue.  I appreciate the heads up on that.

                 

                >>scripting, close and exit.

                 

                I'm thinking -

                 

                Flush Cache To Disk

                Exit Application

                 

                So, if this could be run without user intervention; i..e from ActiveX, that would be ideal.

                • 5. Re: Taskkill Safe for Clean Shutdown FMP on Windows?
                  MarcDolley

                  I have used taskkill before with great success. There's a computer which automatically imports a few hundred thousand records each night into multiple tables across two files. Occasionally, the client would open the database the next day to run reports and forget to close the file or exit FileMaker. The only solution I could come up with was to use taskkill to exit FileMaker (whether it was running or not) before launching the data collection task.

                   

                  This isn't a hosted file. It's a single solution running under FMP 11. It's been running for well over a year now without any issues. I certainly wouldn't recommend doing it, but it does work and hasn't caused any problems. There hasn't been any data corruption and the last time I checked, one file was over 6 Gb and the other was over 12 Gb.