Претражи подршку

Избегните преваре подршке. Никада од вас нећемо тражити да зовете или шаљете поруке на број или да делите личне податке. Пријавите сумњиве радње преко „Пријавите злоупотребу” опције.

Learn More

Windows / DOS command to shut down Firefox

  • 5 одговорa
  • 2 имају овај проблем
  • 1 преглед
  • Последњи одговор послао cor-el

more options

I have an add-on, Auto ShutDown, that works like this; After all downloads are completed, the add-on gives a command to Windows to do one of the following; 1) Shut down the computer, 2) Restart, or 3) Log the user off. These are done by sending a command to Windows to do what I had selected. What I want to know is, is there a command that would shut down Firefox ONLY, leaving the computer running so that other programs can do there jobs. Like virus scan and optimizer programs. The add-on works great, but lacks this command.

I have an add-on, ''Auto ShutDown,'' that works like this; After all downloads are completed, the add-on gives a command to Windows to do one of the following; 1) Shut down the computer, 2) Restart, or 3) Log the user off. These are done by sending a command to Windows to do what I had selected. What I want to know is, is there a command that would shut down Firefox ONLY, leaving the computer running so that other programs can do there jobs. Like virus scan and optimizer programs. The add-on works great, but lacks this command.

Сви одговори (5)

more options

Hello fredmcd-hotmail, use the next commant......but the commant kill firefox, not exactly close it !!!

TASKKILL /F /IM firefox.exe /T


thank you

Измењено од стране ideato

more options

Note that if you do not close Firefox properly, but kill the program that you run the risk to corrupt files in the Firefox profile folder.

You can issue the cmd_quitApplication command to quit Firefox: goQuitApplication()

This function also should do it.

  • resource://gre/chrome/toolkit/content/mozapps/extensions/extensions.js
function quitFirefox() {
var {classes:Cc,interfaces:Ci,utils:Cu} = Components;
var cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
                 createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);
if (cancelQuit.data) return;
var appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].
                 getService(Ci.nsIAppStartup);
appStartup.quit(Ci.nsIAppStartup.eForceQuit);
}

Измењено од стране cor-el

more options

I had read about TASKKILL but was not sure it would close a program or just stop it. Thanks for your input.

more options

Thanks for your answer, Cor-el. I know that you have to close a program properly or, as the man says; 'There Will Be ..... Trouble.' The resource you talked about, where / how can I read it? The program you showed, is it a batch file program, or something else? I have written batch programs before, but I don't know how to use the code you wrote. Many Thanks.

more options

This is JavaScript code that must run in Firefox, just like the Auto ShutDown extension.
That is the only way to close Firefox properly.
All other ways to kill the Firefox program will sooner or later lead to problems.