> Hi Alan
>
> thank you very much for this, i am afraid i dont have much experience with
> this and therefore need some help with understanding it.
>
> I have saved it as a CMD file but am unable to run it as it is - what
> changes do i need to make to it to suit my environment and make it work?
>
> For example, server name is Mickey-SA - i have about 600 printers to
> update
> with the new driver
>
> thanks
> Don
>
> "Alan Morris [MSFT]" wrote:
>
>> plagerism from a co worker
>>
>> Rich has a script called changedrivers.cmd
>>
>> copy all below this line and create your own cmd file
>> ------------------------------------------------------------
>>
>> [ at ]echo off
>> setlocal enableextensions
>>
>> if %3.==. goto usage
>>
>> set NoMath=
>> :: set NoMath=REM
>> set Svr=%1
>> set OldDrv=%2
>> set NewDrv=%3
>>
>> %NoMath% set /a Cnt=0
>>
>> for /f "tokens=1,2 delims==" %%A in ('setprinter -show "%Svr%" 2 ^|
>> findstr
>> "pPrinterName= pDriverName="') do call :ReplaceDriver %%A %%B%
>>
>> [ at ]echo.
>> if "%NoMath%"=="" set Cnt=All
>> [ at ]echo. %Cnt% %OldDrv% drivers replaced with %NewDrv%
>> [ at ]echo.
>>
>> goto :EOF
>>
>> :ReplaceDriver tag "value"
>> :: save printer name
>> if /i "%1"=="pPrinterName" set PrtName=%2& goto :EOF
>> :: is target driver?
>> if /i NOT %2==%OldDrv% goto :EOF
>> :: Replace driver with new driver
>> [ at ]echo Replacing driver on queue %PrtName%. Old: %2, New: %NewDrv%
>> SetPrinter %PrtName% 2 pDriverName=%NewDrv%
>> if errorlevel 1 [ at ]pause
>> %NoMath% set /a Cnt+=1
>> goto :EOF
>>
>> :Usage
>> [ at ]echo.
>> [ at ]echo Change all printers which are using driver X to use driver Y
>> [ at ]echo.
>> [ at ]echo %0 \\SvrName "Old Driver" "New Driver"
>> [ at ]echo.
>> goto :EOF
>>
>>
>>
>>
>> --
>> Alan Morris
>> Windows Printing Team
>> Search the Microsoft Knowledge Base here:
>>
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto>>
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "don" <don[ at ]discussions.microsoft.com> wrote in message
>> news:CDCCBE56-E6D9-469E-9971-28693280FF55[ at ]microsoft.com...
>> > has anyone used the setprinter command?
>> >
>> > i want to be able to use it to point printers to another driver so
>> > that i
>> > can delete the current driver they are currently using
>> >
>> > I cannot delete the current driver because it says it is in use
>> >
>> > has anyone had any experience with this
>> >
>> > thanks
>> > don
>> >
>>
>>
>>