WooYing said:
Is there a script that will allow me to point their exist printer from a NT4
Print Server to a new Print Server on Windows 2003. The printer names will
remind the same all I am looking to do is just repoint their machines
locally to point to the new server. Please advise. Thank you.
First find and download Chgprint.exe. I believe it was/is available
within a resource kit. You can use the same file for Windows 2000 and
Windows XP workstations. Windows NT4 workstations require a different
version of the file. Copy the CHGPRINT executable for 2000/xp to a
directory on a file server and copy the CHGPRINT executable for NT4 to
a different directory on the same file server. Then find and download
defptr.exe (also available within resource kits or from microsoft.com)
and place a copy in both the NT4 directory and the 2000/XP directory.
Then you need to create a TRANSLATEPRINTER.TXT file. Here's what that
file must contain. On the very first line of test type the full path
to a printer on the old NT4 print server. For example:
\\oldprintserver\printqueue1name
Then hit the "tab" button and type the name of the path of the new
print queue you want workstations to change to. For example:
\\newprintserver\printqueue1name
So the first whole line in notepad will look like this:
\\oldprintserver\printqueue1name \\newprintserver\printqueue1name
Remember that's a tab, not spaces between the two. Then on the second
line do the next printer. Type out all of your printers one-by-one
exactly how you want them to be "translated".
\\oldprintserver\printqueue2name \\newprintserver\printqueue2name
\\oldprintserver\printqueue3name \\newprintserver\printqueue3name
\\oldprintserver\printqueue4name \\newprintserver\printqueue4name
Copy this saved TRANSLATEPRINTER.TXT file to the directory where
CHGPRINT.EXE resides (both NT4 and 2000/XP if you have both).
Then try the following within a script:
-----------------------------------
start of script
-----------------------------------
::Set the Purdy Colors First
color 3f
:
etermining Operating System
for /F "tokens=3 delims= " %%i in ('ver') do (set winver=%%i)
md %temp%\chgprint
if "%winver%"=="2000" goto Win2k
if "%winver%"=="Version" goto WinNT
if "%winver%"=="XP" goto WinXP
:WinNT
copy \\fileserver\share\chgprint\WinNT\*.* %temp%\chgprint
goto Logfile
:Win2k
copy \\fileserver\share\chgprint\Win2k\*.* %temp%\chgprint
goto Logfile
:WinXP
copy \\fileserver\share\chgprint\Win2k\*.* %temp%\chgprint
goto Logfile
:Logfile
set chgprintlog=%temp%\chgprint\chgprint.log
goto Execute
:Execute
%temp%\chgprint\chgprint.exe /nodialogs
if errorlevel == 3 if not errorlevel == 4 echo
%COMPUTERNAME%\%USERNAME% nothing to do, no printer connections
installed >> %CHGPRINTLOG%
if errorlevel == 2 if not errorlevel == 3 echo ChgPrint executed from
desktop not running Windows NT >> %CHGPRINTLOG%
if errorlevel == 1 if not errorlevel == 2 echo
%COMPUTERNAME%\%USERNAME% could not locate TranslatePrinter.Txt file >>
%CHGPRINTLOG%
if errorlevel == 0 if not errorlevel == 1 echo
%COMPUTERNAME%\%USERNAME% executed ChgPrint without error. >>
%CHGPRINTLOG%
goto Followup
:Followup
%temp%\chgprint\defptr.exe -i
-----------------------------------
start of script
-----------------------------------
That last line there runs defptr.exe, a little program that prompts the
user through a simple interface to select the printer from a drop down
list, that should be the default pritner. I implemented this because I
noticed that CHGPRINT tends to not preserve the default printer.
Hope that helps.
:Bazooka-Joe