Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

Learn More

Is there a correct way to close Firefox from a .bat file

  • 6 réponses
  • 1 a ce problème
  • 385 vues
  • Dernière réponse par oldchap47

more options

Hi,

I am on windows 10/FF 78.01 and I have a batch file that on closure saves many things to another disk. Recently I added the saving of my Firefox profiles folder. I had read that when exporting/saving this folder one should ensure that Firefox is closed. Is there a tidy way of closing Firefox in my .bat script?

Currently I am using the cmd taskkill /F /IM firefox.exe but I notice that when I reload Firefox it restarts pretty well exactly where it left off rather than starting with my standard set of tabs as defined in my option 'Use current pages'. It's not a big deal but it would nice to know if there is a correct way to close FF that gives the same restart result as when I do a manual hit 'x' /Close n tabs. Thank you


edited to correct the leading lines spaces, to allow content to wrap properly

Hi, I am on windows 10/FF 78.01 and I have a batch file that on closure saves many things to another disk. Recently I added the saving of my Firefox profiles folder. I had read that when exporting/saving this folder one should ensure that Firefox is closed. Is there a tidy way of closing Firefox in my .bat script? Currently I am using the cmd taskkill /F /IM firefox.exe but I notice that when I reload Firefox it restarts pretty well exactly where it left off rather than starting with my standard set of tabs as defined in my option 'Use current pages'. It's not a big deal but it would nice to know if there is a correct way to close FF that gives the same restart result as when I do a manual hit 'x' /Close n tabs. Thank you ''edited to correct the leading lines spaces, to allow content to wrap properly''

Modifié le par the-edmeister

Solution choisie

Thank you FredNcD

Lire cette réponse dans son contexte 👍 0

Toutes les réponses (6)

more options

oldchap47 said

Hi, I am on windows 10/FF 78.01 and I have a batch file that on closure saves many things to another disk. Recently I added the saving of my Firefox profiles folder. I had read that when exporting/saving this folder one should ensure that Firefox is closed. Is there a tidy way of closing Firefox in my .bat script? Currently I am using the cmd taskkill /F /IM firefox.exe but I notice that when I reload Firefox it restarts pretty well exactly where it left off rather than starting with my standard set of tabs as defined in my option 'Use current pages'. It's not a big deal but it would nice to know if there is a correct way to close FF that gives the same restart result as when I do a manual hit 'x' /Close n tabs. Thank you
more options

If you close Firefox using taskkill, the browser will reload the last session thinking it crashed.
I don't think there is a way to close the browser via a script program.

more options

Bit disappointed if there isn't a way to cleanly save the profile from a batch file. 'Firefox close ' would be a nice feature rather than crashing it. Wonder if I could suggest it as a feature somehow?

more options

Most (decent) 'Win32' applications will shut down cleanly when Windows shuts down. In other words (if they are programmed well, then) they will recognise the signal given by Windows that it is shutting down, and will then proceed to close (while Windows waits a little bit for them to do so). Whether or not FF does so (it ought to) or not I'm not sure. Of course, one could test whether or not it does, simply by leaving FF running and then restarting Windows. If when FF starts up again it does not follow the 'I think I wasn't shut down properly'-behavior then you know that FF does listens to the Windows shutdown signal and behaves accordingly, otherwise not.

You could, most likely, back up your FF profile via your batch file while FF is still running (provided it isn't doing a bunch of things when you do so), and so it may not be necessary to first tell FF to shut down.

more options

If you want to leave feedback for Firefox developers, you can go to the Firefox Help menu and select Submit Feedback... or use this link. Your feedback gets collected by a team of people who read it and gather data about the most common issues.

more options

Solution choisie

Thank you FredNcD