icacls "c:\windows\system32\spool\PRINTERS" /grant administrators:(IO)(CI)(OI)F /t
When some of my systems go to print a PDF the spooler just locks up. I can't control what type of PDF files are coming in as they are made by all kinds of software and so the problems begin. I have been working on a batch file that will stop the spooler service if it hasn't already, then run the above command to grant rights to the indicated directory so that the offending files can be deleted from the spooler and restart the spooler service after that has happened. The reason for this is that by default a user can't go in and delete the files. I believe that I have the command correct and it used to work fine in Windows XP and Windows 7 but I can't see why it doesn't work in Windows 8.
Here is the batch file. Please tell me what I have wrong in it.
net stop spoolertimeout/t 3 /nobreak
icacls "c:\windows\system32\spool\PRINTERS" /grant administrators:(IO)(CI)(OI)F /t
c:
cd\windows\system32\spool\PRINTERS
Del *.s*
timeout/t 3
net start spooler
exit