1.

Solve : clear print queue on a remote server?

Answer»

Hi everyone, I hope someone can help me out. I've got an older server running Windows Server 2003, and not very well. The print queue gets clogged up on a daily basis from teachers printing the same document over and over instead of waiting for it to come out. I have a simple batch file set up to stop the print spooler, delete the offending FILES, and restart the spooler. However, I have to log into the server each time. I'd like to put a batch file on my desktop to remotely delete the files. Below is the script I am using, can anyone help with modifying it to be able to do what I want?

@echo off

net stop spooler
del /f e:\spool\printers\*.*
net start spoolerI never realized it was so simple to delete files from the print spooler. Can you not map the server drive E: to your machine.

Code: [Select]@echo off
net use z: \\computername\share
net stop spooler
del /f z:\spool\printers\*.*
net start spooler
net use z: /delete

Note: the computername and sharename are references to the server. Type net use /? at the command prompt for full details.





I'll try it out. I'm not big on scripting, that's why I come to these forums No dice. I get an error about "The PROCESS can not access the file because it is being used by another file."
the script then restarts the spooler and deletes the drive. Any idea why this is HAPPENING? I am able to use my original script while logged into the server with no issues. Here is the script I am running, FOLLOWED by my original script on the server:

@echo off

net use z: \\servername\spool (I moved the queue to another LOGICAL drive to save space on C:\, and made "spool" a shared folder)
net stop spooler
del /f z:\printers\*.*
net start spooler
net use z: /delete

pause (so I could read the msgs before the window closed.)


OLD script on server:
@echo off
rem old spooler
rem del /F %SYSTEMROOT%\system32\spool\PRINTERS\*.*



Discussion

No Comment Found