edutech4schools Posted July 12, 2012 Posted July 12, 2012 Hi, On of my schools is having major issues with print jobs getting stuck in the spool folder, see this post for info: http://www.edugeek.net/forums/hardware/98241-printers-causing-me-no-end-problems.html for the moment I need to find a way to let the staff fix the issue as it happens and think some kind of script would be best, although open to suggestions. I need to create a script that allows a user to stop the spools service running on the server, delete all files in the spool folder and then restart the spool service. I have no idea how I would create this, so thanks for any help.
themightymrp Posted July 12, 2012 Posted July 12, 2012 You need to get a copy of the psexec.exe program (can't remember where from but its free - google it) batch file rough outline: [i]pathtopsexec[/i]\psexec.exe [i]servername[/i] net stop "print spooler" [i]pathtopsexec[/i]\psexec.exe [i]servername[/i] del c:\windows\system32\spools\printers\*.*" [i]pathtopsexec[/i]\psexec.exe [i]servername[/i] net start "print spooler" Something like that might work - you may need to allow the users some more permissions though as I doubt their accounts will be able to do that on a server 1
FN-GM Posted July 12, 2012 Posted July 12, 2012 You need to get a copy of the psexec.exe program (can't remember where from but its free - google it) batch file rough outline: [i]pathtopsexec[/i]\psexec.exe [i]servername[/i] net stop "print spooler" [i]pathtopsexec[/i]\psexec.exe [i]servername[/i] del c:\windows\system32\spools\printers\*.*" [i]pathtopsexec[/i]\psexec.exe [i]servername[/i] net start "print spooler" Something like that might work - you may need to allow the users some more permissions though as I doubt their accounts will be able to do that on a server To use psexec they will need to be local admins on the server. 1
themightymrp Posted July 12, 2012 Posted July 12, 2012 To use psexec they will need to be local admins on the server. Yeah its not an ideal fixit. It would obviously be better to fix the actual problem rather that patch it up like this. Think I will re-read the linked thread and try and come up with something else 1
edutech4schools Posted July 12, 2012 Author Posted July 12, 2012 thanks for the info. Agree its not a good fix but I am only at the school once a week and have been remotely fixing the spooler 3 or more times each day.
ricki Posted July 13, 2012 Posted July 13, 2012 HI It will be a driver I am sure. Have you installed another printer recently and this has just started. Richard
edutech4schools Posted July 13, 2012 Author Posted July 13, 2012 It will be a driver I am sure. Have you installed another printer recently and this has just started. Recently changed the server and all printers from HP to Dell, but still have the same issue.
edutech4schools Posted July 18, 2012 Author Posted July 18, 2012 I am getting PsExec could not start Del on server using the script. Any ideas. pathtopsexec\psexec.exe servername net stop "print spooler" pathtopsexec\psexec.exe servername del c:\windows\system32\spools\printers\*.*" pathtopsexec\psexec.exe servername net start "print spooler"
mikemcsharry Posted November 8, 2017 Posted November 8, 2017 I know this is a fairly old thread but I'm having the same problem and I've nearly got a workaroud but not quite there. The problem we have is that when a user on a Windows 10 laptop prints it sometimes jams up the spooler. I've tried to re-create the problem but I can't. Konica printer on 2012R2 server. The way to fix it is to go to the server, login as admin stop print service, delete temp files and start print service again.. I'm not abou tot let the users loose on that. Picking up the threads above I've nearly succeeded with this script - this does launch a cmd file in the windows\system32 folder of my server at my desktop. So far so good, but I can't delete the printers folder contents >>> The problem I think we are all having is this one... If I go to the console of the serve and log on locally, make a batch file in c:\windows\system32 I can run it from psexec and I can run it locally. IF the batch file tries to get to the spool folder okay Getting to printers folder with batch file is prevented by something - but I don't know what!! I can browse to the spool\printers folder and delete the files no problem. pausef:\fixprintjam\psservice.exe \\svr-ois-dc01 -u ois\?????????? -p ?????????? stop "print spooler" pausef:\fixprintjam\psexec.exe \\svr-ois-dc01 -u ois\?????????? -p ?????????? cmdpausef:\fixprintjam\psservice.exe \\svr-ois-dc01 -u ois\?????????? -p ?????????? start "print spooler"pause
sted Posted November 8, 2017 Posted November 8, 2017 i bet its printing from edge/pdf viewer/modern apps they do not like copiers/printers that need codes the prompt never appears then the screw up the print queue. Ive found 2 workrounds 1 i have a script that deletes all print jobs every 30 mins bit of a brute force approach or remove codes from the printer
ricki Posted November 8, 2017 Posted November 8, 2017 The driver is crashing change the driver if you are using a pcl5 try a pcl6 you get the idea also make sure you have latest drivers Richard
ricki Posted November 8, 2017 Posted November 8, 2017 Is this what you are after https://community.spiceworks.com/scripts/show/50-clear-print-spooler
mikemcsharry Posted November 8, 2017 Posted November 8, 2017 sorry - I cn see line breaks didn't appear above. This one is odd, I ccan't repeat it -but I think I've fixed it - I gave the admin full control of the spool/printers folder and then made a batch file in c:windows\system32 that changed directory to spool/printers and just deletes what's there. the psexec line now runs that batch file 1
mikemcsharry Posted November 8, 2017 Posted November 8, 2017 Hi Ricki - your info from spiceworks was exactly what i was looking for, the code I've put in above uses the pstools download from sysinternals - that lets a user run a simple batch file on a specified PC against the print spooler on the server does that set of tasks.. I agree about drivers - there's nothing in the event logs to give me any clues, but hopefully this is a bit better for them and for me
MatthewL Posted November 8, 2017 Posted November 8, 2017 Something I have seen is when the printer is installed if it uses the WSD ports is creates random issues, change it to a standard TCP/IP one where applicable and you will find some issues might go away.
mikemcsharry Posted November 8, 2017 Posted November 8, 2017 Something I have seen is when the printer is installed if it uses the WSD ports is creates random issues, change it to a standard TCP/IP one where applicable and you will find some issues might go away. Hi Matthew, I had spotted that it was trying to do that, I’m fairly sure it’s all TCP/IP and or server share. I wish I could actually recreate the problem!!
XiJ Posted November 8, 2017 Posted November 8, 2017 Another me too. I write a poweshell script that runs every hour originally I think. I’ve fine tuned it now so it looks for ‘stuck’ print jobs and if it finds any stops the spoiler, deletes Job and restarts. So I could run it more frequently now. And this is a custom driver deployed via Ricoh print driver creator software. I had to use that to get the code prompt to work on clients. I’m hoping when they upgrade the copier we won’t have the problem. It defo comes from using the edge browser or the win 10 photos app.
mikemcsharry Posted November 8, 2017 Posted November 8, 2017 Ah - it’s possibly win10 photos doing it - my test was 8 20MB images from my phone. Of course it worked while I was doing it!!
ricki Posted November 8, 2017 Posted November 8, 2017 Trust me it's a driver are there multiple printers on the print server. If so either disable one type of printer at a time or change one driver at a time. My guess is a photocopier especially if you use encrypt and print
ricki Posted November 8, 2017 Posted November 8, 2017 Another thought do you have multiple servers if so move one printer at a time to the other print server
mikemcsharry Posted November 8, 2017 Posted November 8, 2017 Hi Ricki I’m only in the school one day per week and I feel you’ve nailed it, it might just be a case of when!!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now