Dave R. <dwragle at drbsystems dot com> wrote:
> I'm looking for a way to delete all print jobs for the current user from
> the command line or using a batch file under Windows Vista Business.
I use this under XP. Plus it might not be quite the same thing, but
it could be of interest:
@echo off & setlocal enableextensions
echo +----------------------------------------------------+
echo ¦ CLRSPOOL.CMD Stop and reset print spooler ¦
echo ¦ By Prof. Timo Salmi, Last modified Mon 30-Jan-2006 ¦
echo +----------------------------------------------------+
::
if "%~1"=="?" goto _usage
if "%~1"=="/?" goto _usage
::
:: The path to the spooler files
set spool_=C:\WINDOWS\system32\spool\PRINTERS
::
:: Spool contents
dir "%spool_%"
echo.
::
:: Ask for confirmation
set ask_=
set /p ask_="Reset the print spooler [Y/n]?"
if /i [%ask_%]==[n] goto _out
::
:: Clear the spooler
net stop spooler
for %%f in ("%spool_%\*.*") do (
if exist "%%f" del "%%f"
)
net start spooler
:: See FAQ item #2 for an explanation of the next line
dir "%spool_%"
if not defined cmdbox if defined PauseIfFromDesktop pause
goto _out
::
:_usage
echo.
echo Usage: CLRSPOOL
echo.
echo High enough user privileges are required to complete this task.
echo Else the net stop/start commands will just produce error
messages.
goto _out
::
:_out
endlocal & goto :EOF
All the best, Timo
--
Prof. Timo Salmi ftp &
http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
private.php?do=newpm&u= <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Useful script files and tricks
ftp://garbo.uwasa.fi/pc/link/tscmd.zip