Trang web này sẽ có chức năng hạn chế trong khi chúng tôi trải qua bảo trì để cải thiện trải nghiệm của bạn. Nếu một bài viết không giải quyết được vấn đề của bạn và bạn muốn đặt câu hỏi, chúng tôi có cộng đồng hỗ trợ của chúng tôi đang chờ để giúp bạn tại @FirefoxSupport trên Twitter và /r/firefox trên Reddit.

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

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

  • 6 trả lời
  • 1 gặp vấn đề này
  • 556 lượt xem
  • Trả lời mới nhất được viết bởi 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''

Được chỉnh sửa bởi the-edmeister vào

Giải pháp được chọn

Tất cả các câu trả lời (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

Giải pháp được chọn

Thank you FredNcD