1 2 Previous Next 15 Replies Latest reply on Mar 6, 2016 7:10 PM by user19752

    'fmsadmin close' Windows batch file won't run

    sharpie

      Hi

       

      I'm trying to do the Activity 49.4 in FTS Advanced , I've checked all the basics .. e.g. I had to turn off the display option that hides file name extensions.  It's definitely a Windows Batch file now and not txt as it was when I first saved it.  I even had to correct a typo in my original writing of the 'fmsadmin close' batch file.  The command prompt still doesn't run it, and it returns:  the text from within the batch file and then a line that says

       

      ''¬¬¬fmsadmin' is not recognised as an internal or external command, operable program or batch file.

       

      I checked the file a few times to make sure there are no blank spaces or extra characters before fmsadmin and there are not, so I don't know what the extra characters in the command prompt are for.

       

      Also I don't know if it makes any difference that I'm running it on Windows 7 and not Windows Server 2008 or 2012 ?

       

      I hope you can help.

        • 1. Re: 'fmsadmin close' Windows batch file won't run
          Menno

          fmsadmin is not registered in the system-variables (which you can do manually), so you should go to the directory where fmsadmin.exe is situated:

           

           

          "C:\Program Files\FileMaker\FileMaker Server\Database Server\fmsadmin.exe" CLOSE -uusername -ppassword -y

           

          substitute username and password for the correct values and it should work fine.

           

          If you want to make a backup you can use:

           

          "C:\Program Files\FileMaker\FileMaker Server\Database Server\fmsadmin.exe" backup -u username -p password --verify

           

          note that there is a space between -u and username as well as there is a space between -p and password

           

          If you want to use just fmsadmin on the commandline, you should add the system-variable name: "fms_home" ; value: C:\Program Files\FileMaker\FileMaker Server\Database Server\  in the system-variables

          • 2. Re: 'fmsadmin close' Windows batch file won't run
            sharpie

            ok.  I can type fmsadmin commands straight into the command prompt and they work without typing any paths.  Just from this batch file it doesn't work.  So I've placed the batch file in:-

             

            C:\Program Files\FileMaker\FileMaker Server\Data\Scripts and type the following into the command line:

             

            cd "C:\Program Files\FileMaker\FileMaker Server\Data\Scripts"

             

            press enter and next type the command

             

            fmserverclose.bat

             

            which is the name of the file and that's when I get the fmsadmin not recognized error.

            • 3. Re: 'fmsadmin close' Windows batch file won't run
              wimdecorte

              sharpie wrote:

               

               

              ''¬¬¬fmsadmin' is not recognised as an internal or external command, operable program or batch file.

               

               

               

              The extra characters in front of fmsadmin are weird and I think artifacts of you copying from the FTS document?  They are probably some invisible high or low ascii debris from the PDF.

               

              Delete that whole line that starts with "fmsadmin" and type it in manually then try it again.

              • 4. Re: 'fmsadmin close' Windows batch file won't run
                Menno

                a batchfile is exactly the same as running a (number of) command(s) on the command-line. The FTS is unfortunately incomplete regarding writing scripts in windows and the installation of FMS in windows also has a few flaws. My previous post was not clear enough on that, I'm sorry.

                 

                The contents for the file fmserverclose.bat in 49.4 is:

                fmsadmin close -y -u <user> -p <pass> -t 30 -m "The server will shut down for maintenance in 30 seconds. It will be available again in 15 minutes."

                that exact script only works for windows if you change the FMS_HOME environment-variable in windows the installation of FMS writes:

                C:\Program Files\FileMaker\FileMaker Server\

                where should be writen:

                C:\Program Files\FileMaker\FileMaker Server\Database Server\

                See the screenshot below to get to this environment-variable:

                Screenshot.png

                if you don't want or dare to change this setting you must change the content of your bat-file into:

                "C:\Program Files\FileMaker\FileMaker Server\Database Server\fmsadmin.exe" close -y -u <user> -p <pass> -t 30 -m "The server will shut down for maintenance in 30 seconds. It will be available again in 15 minutes."

                • 5. Re: 'fmsadmin close' Windows batch file won't run
                  wimdecorte

                  Menno van Beek wrote:

                   

                   

                  The contents for the file fmserverclose.bat in 49.4 is:

                  fmsadmin close -y -u <user> -p <pass> -t 30 -m "The server will shut down for maintenance in 30 seconds. It will be available again in 15 minutes."

                  that exact script only works for windows if you change the FMS_HOME environment-variable in windows the installation of FMS writes:

                   

                  Hi Menno,

                   

                  Thanks for posting the complete instructions.

                   

                  Since FMS13, the FMS installer takes care of that so it should just work without specifying the complete path.  At least it does on Windows Server installs, perhaps it is different on Win 7/8, not sure.

                  • 6. Re: 'fmsadmin close' Windows batch file won't run
                    Menno

                    Hi Wim,

                     

                    i found that the installer does create the fms_home system-variable, but the command fmsadmin still is never recognized, because the variable is flawed. Add

                    Database Server\

                    at the end and

                    fmsadmin

                    is recognized on the command-line and in scripts

                    • 7. Re: 'fmsadmin close' Windows batch file won't run
                      sharpie

                      Thanks Wim.  I can confirm it wasn't down to copy and pasting.  I'll try the system variables thing again and give it a go.

                      • 8. Re: 'fmsadmin close' Windows batch file won't run
                        wimdecorte

                        Still thinking about those weird leading characters.   Go ahead install the free Notepad++ tool and use that to display any invisible characters, are there any?

                         

                        Alternatively you can put your cursor just after the "f" in fmsadmin, use the arrows to go one character to the left and then use backspace: does the line jump up immediately or does seem not to do anything (if the latter then it is deleting an invisible character).

                        • 9. Re: 'fmsadmin close' Windows batch file won't run
                          sharpie

                          So the strange characters are returned from the command line even when I've typed the batch file all manually, so still not sure what they're all about.

                           

                          Menno, I wasn't cautious about adding a system variable, I Googled it and added fms_home myself after you first mentioned it.  I have to say I hadn't noticed whether it was there already, as I didn't look, and there's only one in there now, so either it wasn't there, or the one I added did overwrite the one that was there.  Also from what I Googled it looked like I needed to append a FileMaker path to the 'path' system variable. Although: C:\Program Files\FileMaker\FileMaker Server\Database Server\ was already there.  I left it there, and added:  C:\Program Files\FileMaker\FileMaker Server\Database Server\fmsadmin.exe , then I tried deleting it and just leaving the full path including fmsadmin.exe there . Anyway for good measure I've just set it back to what it was originally now which is the path to Database Server without the fmsadmin.exe part .

                           

                          fms_home I've changed the variable name to uppercase because that's how it appeared in your screenshot.

                           

                          What I tried Menno was to change the text in the batch file to include the path as you suggested but then it just returned a different error of: The filename, directory name or volume label syntax is incorrect.

                           

                          Anyway none of this has made any difference, I've restarted my machine several times after making changes just in case but my machine doesn't seem to respond to the commands when they're in a batch file , only when I type straight into the command line.  I might leave it. My best guess is it's down to it being an installation on Windows 7 rather than a Server Operating System.

                          • 10. Re: 'fmsadmin close' Windows batch file won't run
                            Menno

                            Maybe the problem is W7, but the addition to the fms_home variable is what does the trick for me.

                             

                            You should add:

                            C:\Program Files\FileMaker\FileMaker Server\Database Server\

                            and leave

                            fmsadmin.exe

                            away though, that addition won't work in fms_home variable. The name is not really inportant, you could also add another name, the result will be the the program "cmd.exe" will add that directory to the list of places it looks for programs that it can command.

                             

                            I don't have the scripts in the FM-server directory though, because in my opnion, no userdata at all is supposed to be in the program files directory or any subdirectory. Instead i have the scripts that i use for fmserver situated in:

                            %userprofile%\AppData\Local\FileMaker\Scripts\

                            The directory "Scripts" is arbitrary :-)

                             

                            System-variable in Windows are not case-sensitive and you can call the in .cmd, .bat and on the commandline as %variablename% for whatever use you have for it. So in the case of "%userprofile%" it substitutes in my case as "C:\Users\Administrator\"

                             

                            I have never changed the path-variable to tweak anything, so i think you also do not need to do that. I have a W7 VM here so I'll throw an FMS14 install on it and try it there and will let you know what happens.

                             

                            Just a few questions to make sure everything is the same: You installed FMS14? Is the install standard and is the user "system" running the service fmserver?

                            • 11. Re: 'fmsadmin close' Windows batch file won't run
                              sharpie

                              Hi

                               

                              Yes I installed FMS14 from FDS Subscriber benefits.  Yes FileMaker Server is a running service, which I usually manually stop before shutting down the machine.  It restarts automatically on bootup usually.  I've just checked, it's definitely currently running.

                              • 12. Re: 'fmsadmin close' Windows batch file won't run
                                Menno

                                Hi sharpie, unfortunately my W7 installation is 32bit and not 64-bit :-(. I also found in the FMI-specs that W7 is not in the list of supported OS's. For running FMS14 on Windows you need at least Server 2008R2, Server 2012 or Server 2012R2. That together may result in fmsadmin not reacting properly. I can assure that it works fine under 2008R2, 2012 and 2012R2, because I have running all these OS's here.

                                • 13. Re: 'fmsadmin close' Windows batch file won't run
                                  Menno

                                  I dug a little in my backups and found an W7-64-bit image and installed FMS14v4 there and the only adjustment I made was to the FMS_HOME system-variable which was installed by the FMS-installer. It works exactly as expected so W7 is not the problem.

                                  See the screenshot from my commandline-screen. First I close and open the files using the command-line commands. Then I change directory to the FMS-scripts directory and run the "close.cmd" file as in the exercise in 49.4 in FTS:Screenshot.png

                                  Make sure everything is standard and change the system-variable FMS_HOME in windows from

                                  C:\Program Files\FileMaker\FileMaker Server\

                                  to

                                  C:\Program Files\FileMaker\FileMaker Server\Database Server\

                                  and it should work just fine. If it doesn't work for you, I don't know what to suggest to you anymore, sorry.

                                  • 14. Re: 'fmsadmin close' Windows batch file won't run
                                    sharpie

                                    Hello Menno

                                     

                                    Thanks for the effort you've gone to trying to help out. I thought I'd better move on through the rest of the FTS.  I do understand the concept, and it partially works on my machine.. I've actually had some batch files on my machine with some fmsadmin commands in it that partially run; it runs some of the fmsadmin commands from within the .bat file and not others, others give back the same error that I previously mentioned (fmsadmin not a recognized command) , so all a bit strange really.  Especially that fmsadmin close simple script not working at all, I felt like I could spend the rest of my life on it, and wasn't worth it.

                                     

                                     

                                    So anyway, thanks for your help, I'm carrying on with FTS for now.  If I get time I'll come back to it at some point and try out what you've said again , and I'll post back here to say how I've got on.

                                    1 2 Previous Next