將以下內容存為 restart prn.bat
net stop "Print Spooler"
del %SystemRoot%\system32\spool\PRINTERS\*.* /q
net start "Print Spooler"
net start "Print Spooler"
有2次 net start "Print Spooler" 是避免啟動失敗!
請參考
<pre class="c" name="code">
sc stop Spooler
del /s /q %SystemRoot%\system32\spool\PRINTERS\*.*
sc start Spooler