Thursday 1 March 2012

Fixing Windows 7 Print Spooler crashing constantly (Event ID: 7031)

I got bitten by an irritating bug Microsoft introduced in some update during 2011 which causes the print spooler of Windows 7 64-bit (Home Premium and Xerox Phaser 6140DN network printer in my case, reported to do so on other flavours of Windows 7 and other printer manufacturers especially HP and Epson as well.)

Symptoms observed are: 
  • Printer stops responding
  • Network printers vanish from the Start -> Devices and Printers dialogue
  • Event viewer will report in System evenlog continuous crashes (ID 7031) whenever the print spooler restarts (ID 7036)
  • At least Xerox drivers cannot be reinstalled because the print spool service is down
  • The print spooler service can be started and will promptly crash within seconds of restart
Mostly you get direction to run the Microsoft Printer Fix-it utility, which does absolutely nothing to this problem. Other suggested remedies are tweaking the registry which is printer manufacturer specific and might work for you or not. 

What works for me, though does not remove the problem permanently (it has reoccurred once for me and being fixed with the instructions below both times) is presented below:

Clear Printer Spooler files and enable the spooler service

1. Click the Start Button, type "Services" (without the quotation marks) in the open box and click OK.
2. Double-click "Printer Spooler" in the Services list.
3. Click Stop and click OK.
4. Click the Start Button, type "%WINDIR%\system32\spool\printers" in the open window, and delete all files in this folder. 

If you're not running with Administrator privileges you will be prompted to take control of the directory before you are shown the contents of it. 

Or if you can make a new shortcut on your desktop to CMD.EXE and right click the icon and select 'Run as Administrator...' since you need admin privileged to delete the spooler files. Then 

CD %WINDIR%\system32\spool\
DEL printers\*.*

Answer Y when prompted

5. Click the Start Button, click Run, type "Services" (without the quotation marks) in the open box and click OK.
6. Double-click "Printer Spooler" in the Services list to restart it