For a long time I've had trouble getting a Windows 7 weekly scheduled task to complete. Among its actions is a Spybot scan with immunization. The task would often stall when it got to Spybot and not continue despite the /autoclose parameter.

I've just now figured out that another user typically leaves their session logged in, with Firefox active, and that the open browser is likely causing the delay. For now, I've removed autoimmunization from the task.

Does anyone have suggestions on how to either automatically force Firefox to close, force the user to log off, or otherwise ensure that immunization will be automated? Bonus points if this can be done using only default commands and programs.