- @echo off
- echo 停止打印服务
- net stop Spooler
- echo 清理打印暂存
- reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers" /v "DefaultSpoolDirectory">%temp%\$cd$.txt
- for /f "skip=4 tokens=3 delims= " %%i in (%temp%\$cd$.txt) do set rarpath=%%~fi
- REM 下面的 del 命令有风险,请谨慎执行
- REM del /s /q %rarpath%\*.*
- ping -n 2 127.0.0.1>nul
- echo 重新启动打印服务
- net start Spooler
- echo 完成!!!!
- pause
复制代码 试试这个 |