Files
wincomputerinfo/clearspooler.bat
Ivan Carlos de Almeida 72ae6f8f6c
Some checks failed
Build, Push, Publish / Build & Release (push) Failing after 2s
first load
2025-12-16 04:45:10 -03:00

21 lines
720 B
Batchfile

@echo off
:: Prompt to Run as administrator
Set "Variable=0" & if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
fsutil dirty query %systemdrive% >nul 2>&1 && goto :(Privileges_got)
If "%1"=="%Variable%" (echo. &echo. Please right-click on the file and select &echo. "Run as administrator". &echo. Press any key to exit. &pause>nul 2>&1& exit)
cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "%~0", "%Variable%", "", "runas", 1 > "%temp%\getadmin.vbs"&cscript //nologo "%temp%\getadmin.vbs" & exit
:(Privileges_got)
net stop spooler
DEL /F /S /Q %systemroot%\System32\spool\PRINTERS\*
net start spooler
:endSuccess
echo Printer Spool tasks completed
echo.
:end
pause
exit