Share via

Is there a way to run a batch file to restart the print spooler?

Anonymous
2024-06-29T02:36:14+00:00

My wife is learning to hate Windows. The print spooler keeps stopping which means she cannot print anything even to her local USB printer. This never happens on my Windows 11 laptop.

There is a sequence of net stop spooler then net start spooler that will do the job but the prospect of asking her to open a batch file as Administrator is more than I can face. Open Services to stop and start the Spooler? No. I want either Microsoft to fix this intermittent headache (which updates do not fix) or give a way that can be reduced to an batch file on her desktop.

Windows for home | Windows 11 | Devices and drivers

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-06-29T03:39:30+00:00

    Hi Clayton,

    I'm Ramesh, here to answer your query at the Microsoft Community.

    You can create a batch file that restarts the spooler service without showing the UAC prompt.

    Step 1. Create a scheduled task using the following command from an admin Command Prompt.

    schtasks /create /sc ONCE /st 00:00 /tn "RestartSpooler" /tr "c:\windows\spooler.bat" /rl highest

    (You should see the output "SUCCESS: The scheduled task "RestartSpooler" has successfully been created.")

    Image

    Step 2. Create a file named "spooler.bat" using Notepad. Paste the following contents into it.

    net stop spooler
    net start spooler
    

    Image

    Save the file as "spooler.bat" and close Notepad.

    Move spooler.dat to the "C:\Windows" folder.

    Step 3. Create a desktop shortcut to the scheduled task so the batch file runs without showing the UAC prompt.

    Here's the shortcut command-line:

    C:\Windows\System32\schtasks.exe /run /tn "\RestartSpooler"


    Now, to stop and start Print Spooler, you need only run the RestartSpooler file shortcut on the desktop.

    Assign a nice-looking icon for the shortcut.

    Image

    9 people found this answer helpful.
    0 comments No comments