@Echo off
Color A
Title Fix Print spooler

rem This batch file provides a
rem Fix for the Print Spooler

net stop spooler
Takeown /A /F C:\Windows\System32\win32spl.dll
icacls  "C:\Windows\System32\win32spl.dll" /grant builtin\administrators:F
icacls  "C:\Windows\System32\win32spl.dll" /grant SYSTEM:F
ren  C:\Windows\System32\win32spl.dll win32spl.dll.old

Takeown /A /F C:\Windows\System32\localspl.dll
icacls  "C:\Windows\System32\localspl.dll" /grant builtin\administrators:F
icacls  "C:\Windows\System32\localspl.dll" /grant SYSTEM:F
ren  C:\Windows\System32\localspl.dll localspl.dll.old

Takeown /A /F C:\Windows\System32\spoolsv.exe
icacls  "C:\Windows\System32\spoolsv.exe" /grant builtin\administrators:F
icacls  "C:\Windows\System32\spoolsv.exe" /grant SYSTEM:F
ren  C:\Windows\System32\spoolsv.exe spoolsv.exe.old

Echo --------------------------------------------------------------------------
Echo adding regkey RpcAuthnLevelPrivacyEnabled = 0
Echo --------------------------------------------------------------------------

rem add regkey
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print" /v RpcAuthnLevelPrivacyEnabled /t REG_DWORD /d 0 /f
