Jump to content
EduGeek EdSec 2026 is on Tuesday in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Hi,

 

I'm having a problem managing my print queues and disk space and wonder if anyone here knows of a program or script that'll automate the whole process. Something I can set to run at the end of every day and will automatically delete any job older than 7 days from all the printers on the server?

 

Cheers

 

Terry.

Posted

I declare myself a script-kiddy genius :cool:

 

@echo off
net stop pcprintprovider
net stop spooler
forfiles /p c:\windows\system32\spool\printers /d -7 /c "cmd /c del @files /q /f"
net start spooler
net start pcprintprovider

 

job done :D

Posted


echo Step 1: Stop the Print Spooler
echo ------------------------------
net stop spooler
net stop pcprintprovider
echo Services have been stopped.

echo Step 2: Erasing old print jobs
echo -------------------------------------------------
del /Q /F /S "%systemroot%\System32\Spool\Printers\*.*"
echo Deleted Old Print Jobs - Done!


echo Step 3: Problems eliminated! Restarting printer services
echo --------------------------------------------------------
net start spooler
net start pcprintprovider
echo Services has been restarted!
echo.

echo Step 4: Try printing again.
pause

 

I have the above obviously just added in your extra servce for pcprintprovider

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...