Recommended Posts

Hello there!

I have a server with print server functionality on it. Windows 2000 Server to be exact. When I create a new printer on the server, i give it a name, ip, etc. all of the appropriate info. So since the server has the printer shared from it (the printer is located on the LAN--but the print queue is on the server), when everone logs in, they see all of the network printers thru a printers.txt on their local C:\winnt\ directory.

Now here is my question: Every time I create a new printer on the server, over 50 Printer.txt files have to be updated. Is there anyway to make the updating easier than manual recopy! GPO perhaps?

thanks for the help

SCSA

Share this post


Link to post
Share on other sites
Hello there!

I have a server with print server functionality on it. Windows 2000 Server to be exact. When I create a new printer on the server, i give it a name, ip, etc. all of the appropriate info. So since the server has the printer shared from it (the printer is located on the LAN--but the print queue is on the server), when everone logs in, they see all of the network printers thru a printers.txt on their local C:\winnt\ directory.

Now here is my question: Every time I create a new printer on the server, over 50 Printer.txt files have to be updated. Is there anyway to make the updating easier than manual recopy! GPO perhaps?

thanks for the help

SCSA

I could think of this:

- put the printers.txt on a network share

- set up a xcopy in a domain logon-script or in the autostart folder on each computer that copies over printers.txt from the source to the dest if it has changed

Share this post


Link to post
Share on other sites

Just tell you users to browse to \\whateverisyourserver. Or let XP automatically search for shared folders and printers.

Share this post


Link to post
Share on other sites

the workstations are win2k. See i was hoping that some sort of script ot batch file could run to always update. it makes so much easier than having to recopy a brand new printers.txt to everyworkstaion. ihate doing this everytime i have a new printer!!!...

any suggestions?

thx for your help in advance!

SCSA

Share this post


Link to post
Share on other sites

I assume the workstations are in a domain. You can do a

1. logon-script (a simple xcopy if file changed) whenever a user logs in it checks if there is a newer printers.txt and downloads it if necessary. Message the users to logoff/logon whenever you change the printers.txt.

2. Add a computer startup script in the domain policy doing the same as above.

3. Just do a simple script file file that distributes the printers.txt to all workstations.

The script (xcopy command) could look like this:

xcopy \\server\share\printers.txt local-folder /D /Y

Edited by stefanpi

Share this post


Link to post
Share on other sites

How about a link on the clients ?

A shortcut to the printers.txt on a network share : that printers.txt is up-to-date.

Alternatively, use a simple copy statement in the logon script.

If you place a shortcut in the 'all users' startmenu to \\printserver\printers they always have

a good way to see and connect to all printers.

There's also a script you could use to present the printers, or connect printers by subnet.

Best of all, tell us what you are trying to accomplish ?

That way we may be able to help you better and maybe offer tailormade alternatives.

Share this post


Link to post
Share on other sites

here's a nice KIX script.

It needs wkix32.exe and kixforms.dll - both free from http://KiXscripts.com.

Just copy the below text in a textdocument and name it addprinter.kix

You can even put in a picture of your IT dept or company name, change colours, etc.

This script needs only minor tweaking to adapt it to your environment.

;===============================================================================================

;**** Created with KiXscripts Editor | http://KiXscripts.com ****

;**** Last Modified on 05/04/2003 at 11:09:13 AM by dcox ****

;===============================================================================================

;Add Printer Connection script

;Packaged as AddPrinter.exe with wkix32.exe

;Polls selected print server for print shares and lists them

;allows user to select desired print share and connect to it (assuming they have permissions)

;optionally setting as default printer

;returns error messages if connection fails

;default print server can be hard-coded, or added in command line

;requires KIXforms.dll be registered on client, ver 2.20 minimum

;based on Add Printer script submitted by Mathijs Tieleman to KiXscripts.com

;Apr. 03, 2003 [DCox]

;School Disrict 68, Nanaimo, BC, Canada

;Syntax: AddPrinter.exe [PrintServer]

Break ON

$ScriptVer = 1.0

$ScriptTitle = "Add Printer Connection"

$ScriptAbbr = "AddPrinter"

;Requirements: KiXtart ver 4.12, KIXforms 2.20

;substitute your own method for checking this, below.

;$UpdtReq = FALSE

;$KIXVER = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\SD68\KIX","Version")

;If $KIXVER < 4.12

; $UpdtMsg = "KiXtart logon processor files are not current.@CRLFThis application requires version 4.12 minimum"

; $UpdtREQ = TRUE

;EndIf

;$KIXFormsVER = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\SD68\KIXforms","Version")

;If $KIXformsVER < 2.20

; $UpdtMsg = $UpdtMsg + "@CRLFKIXforms.dll is not current.@CRLFThis application requires version 2.20 minimum"

; $UpdtREQ = TRUE

;EndIf

;If $UpdtREQ = TRUE

; $Resp = MessageBox($UpdtMsg,$ScriptTitle,16)

; Exit

;EndIf

;

Dim $Index, $S_Index, $ShareName, $PrinterName, $Location, $PSRV, $FullShare, $Default

$LeftMargin = 20

;--------------------------

;check command line for print server, else use default

$CmdLine = CmdLine()

If $CmdLine > ""

$PSRV = $CmdLine

Else

$PSRV = "CNTNLLEFAX02"

EndIf

;--------------------------

;***** Main Form Properties *****

$form = CreateObject("kixtart.form")

$form.ScaleWidth = 350

$form.ScaleHeight = 325

$form.center

$form.caption = "Add Printer Dialog"

;***** Control Properties *****

$lblMain = $form.Label

$lblMain.width = 300

$lblMain.height = 30

$lblMain.Left = $LeftMargin + 10

$lblMain.top = 0

$lblMain.caption = "Connect Network Printer"

$lblMain.FontName = "Arial Black"

$lblMain.FontSize = 16

$txtPrintSrvr = $form.textbox

$txtPrintSrvr.width = 150

$txtPrintSrvr.height = 20

$txtPrintSrvr.Left = $LeftMargin

$txtPrintSrvr.top = 50

$txtPrintSrvr.caption = $PSRV

$txtPrintSrvr.FontName = "MS Shell Dlg"

$txtPrintSrvr.FontSize = 8

$txtPrintSrvr.OnClick = "SearchBtn_Click()"

$lblSearchProgress = $form.Label

$lblSearchProgress.width = 150

$lblSearchProgress.height = 20

$lblSearchProgress.Left = $LeftMargin

$lblSearchProgress.top = 75

$lblSearchProgress.caption = ""

$lblSearchProgress.FontName = "MS Shell Dlg"

$lblSearchProgress.FontSize = 10

$lblSearchProgress.FontItalic = 1

$lblSearchProgress.ForeColor = "RED"

$lblPrintSrvr = $form.Label

$lblPrintSrvr.width = 100

$lblPrintSrvr.height = 15

$lblPrintSrvr.Left = $LeftMargin

$lblPrintSrvr.top = 35

$lblPrintSrvr.caption = "Print Server Name:"

$lblPrintSrvr.FontName = "MS Shell Dlg"

$lblPrintSrvr.FontSize = 8

$cmdSearchBtn = $form.CommandButton

$cmdSearchBtn.width = 50

$cmdSearchBtn.height = 20

$cmdSearchBtn.Left = $LeftMargin + 160

$cmdSearchBtn.top = 50

$cmdSearchBtn.caption = "&Search"

$cmdSearchBtn.FontName = "MS Shell Dlg"

$cmdSearchBtn.FontSize = 8

$cmdSearchBtn.OnClick = "SearchBtn_Click()"

$lstPrinters = $form.ListView()

$lstPrinters.width = 310

$lstPrinters.height = 190

$lstPrinters.Left = $LeftMargin

$lstPrinters.top = 110

$lstPrinters.FontName = "MS Shell Dlg"

$lstPrinters.FontSize = 8

$lstPrinters.MultiColumn = False

$lstPrinters.ScrollAlwaysVisible = True

$lstPrinters.Sorted = 1 ; Yes, sort the first column

$lstPrinters.MultiSelect = False ; Allow more than one selection

$lstPrinters.GridLines = True ; Show gridlines in report view

$lstPrinters.View = 3 ; Report view

$lstPrinters.FullRowSelect = True ; Allow user to select the entire row

$lstPrinters.OnClick = "List_Click()"

$lstPrinters.OnDoubleClick = "ConnectBtn_Click()"

$= $lstPrinters.Columns.Add("Name",146,0)

$= $lstPrinters.Columns.Add("Location",146,0)

$= $lstPrinters.Columns.Add("Share",0,0)

$lblPrinters = $form.Label

$lblPrinters.width = 100

$lblPrinters.height = 15

$lblPrinters.Left = $LeftMargin

$lblPrinters.top = 95

$lblPrinters.caption = "Available Printers"

$lblPrinters.FontName = "MS Shell Dlg"

$lblPrinters.FontSize = 8

$cmdConnectBtn = $form.CommandButton

$cmdConnectBtn.width = 100

$cmdConnectBtn.height = 20

$cmdConnectBtn.Left = $LeftMargin + $lstPrinters.width - $cmdConnectBtn.width

$cmdConnectBtn.top = 90

$cmdConnectBtn.caption = "&Connect Printer"

$cmdConnectBtn.FontName = "MS Shell Dlg"

$cmdConnectBtn.FontSize = 8

$cmdConnectBtn.Enabled = 0

$cmdConnectBtn.OnClick = "ConnectBtn_Click()"

$cmdCloseBtn = $form.CommandButton

$cmdCloseBtn.width = 50

$cmdCloseBtn.height = 20

$cmdCloseBtn.Left = $LeftMargin + 260

$cmdCloseBtn.top = 50

$cmdCloseBtn.caption = "C&lose"

$cmdCloseBtn.FontName = "MS Shell Dlg"

$cmdCloseBtn.FontSize = 8

$cmdCloseBtn.OnClick = "quit()"

;***** Show the form *****

$form.show

$cmdSearchBtn.SetFocus

;***** While Looping to display the form *****

While $form.visible

$=Execute($form.doevents)

Loop

;***** End of Form *****

Exit

;*********************************************************************************************************

;***************************************** User Defined Functions Below **********************************

;*********************************************************************************************************

Function CmdLine()

;Strip path and executable from EXECmdLine variable

$x = InStr($EXECmdLine,".exe ") + 4

$CmdLine = Right($EXECmdLine,Len($EXECmdLine)-$x)

EndFunction

;----------------------------------

Function List_Click()

If $lstPrinters.FocusedItem.Selected

$cmdConnectBtn.Enabled = 1

EndIf

EndFunction

;----------------------------------

Function ConnectBtn_Click()

If NOT $lstPrinters.FocusedItem.Selected

Return

EndIf

$PrinterName = $lstPrinters.FocusedItem.SubItems(0).Text

$Location = $lstPrinters.FocusedItem.SubItems(1).Text

$ShareName = $lstPrinters.FocusedItem.SubItems(2).Text

$FullShare = "\\" + $PSRV + "\" + $ShareName

$FullName = "\\" + $PSRV + "\" + $PrinterName

$Resp = MessageBox("Ready to add a printer connection for $PrinterName in $Location.@CRLF@CRLFSet as Default Printer?",$ScriptTitle,35)

Select

Case $Resp = 2

$Msg = "Result was CANCEL"

Case $Resp = 6

$Msg = "Result Was YES"

$ = AddConnection($FullShare,1)

Case $Resp = 7

$Msg = "Result was NO"

$ = AddConnection($FullShare,0)

EndSelect

EndFunction

;----------------------------------

Function SearchBtn_Click()

If $txtPrintSrvr.text = ""

Return

EndIf

$txtPrintSrvr.BackColor = $form.BackColor

$cmdSearchBtn.Enabled = 0

$cmdConnectBtn.Enabled = 0

$cmdCloseBtn.Enabled = 0

$lblSearchProgress.caption = "Searching..."

If $S_Index > 0

For $i = 0 to $S_Index

$lstPrinters.Items(0).Remove

Next

EndIf

$Index = 0

$S_Index = 0

$PSRV = $txtPrintSrvr.text

:Loop1

$KeyName = EnumKey("\\$PSRV\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlset\Control\Print\Printers\", $Index)

If @ERROR = 0

$ShareName = ReadValue("\\$PSRV\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlset\Control\Print\Printers\$KeyName","Share Name")

If $ShareName > ""

$Item = $lstPrinters.Items.Add($KeyName)

$Item.SubItems(1).Text = ReadValue("\\$PSRV\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlset\Control\Print\Printers\$KeyName","Location")

$Item.SubItems(2).Text = $ShareName

$S_Index = $S_Index + 1

EndIf

$Index = $Index + 1

Goto Loop1

EndIf

$PNum = $S_Index - 1

$txtPrintSrvr.BackColor = "White"

$cmdSearchBtn.Enabled = 1

$cmdCloseBtn.Enabled = 1

$lblSearchProgress.caption = ""

EndFunction

;--------------------------------------

Function AddConnection($FullShare,$Default)

$cmdSearchBtn.Enabled = 0

$cmdConnectBtn.Enabled = 0

$cmdCloseBtn.Enabled = 0

$lblSearchProgress.caption = "Connecting..."

If AddPrinterConnection("$FullShare") = 0

$Msg = "Printer connection added"

$MType = 64

Else

$Msg = "Printer connection Failed.@CRLF@CRLFError Message Returned was: @SERROR"

$MType = 16

Goto ConnectionMsg

EndIf

If $Default = 1

If SetDefaultPrinter("$FullName") = 0

$Msg = $Msg + ", and set as default printer"

$MType = 64

Else

$Msg = $Msg + ".@CRLF@CRLFAttempt to set it as Default Printer failed.@CRLF@CRLFError Message Returned was: @SERROR"

$MType = 16

EndIf

EndIf

:ConnectionMsg

$Resp = MessageBox($Msg,"Add Printer Message",$MType)

$cmdSearchBtn.Enabled = 1

$cmdConnectBtn.Enabled = 1

$cmdCloseBtn.Enabled = 1

$lblSearchProgress.caption = ""

EndFunction

Share this post


Link to post
Share on other sites

happen to have a webserver in your company ?

how about a webpage that holds all printers ?

( like HP Laserjet 4000 - black and white - 1st floor - \\printserver\printername )

Just update that page and you're done....

Share this post


Link to post
Share on other sites

No you didn't bother me but just pu a shortcut to a file on a server on the desktop everywhere. Or someplace your users can easily find it.

Share this post


Link to post
Share on other sites
I want to make it so the users dont have to do anything, completely transparent.

SCSA

so why not use a batchfile or logon script to connect all printers ?

Every user gets all printers, and you only have to adapt the batchfile once.

Share this post


Link to post
Share on other sites

I'm not sure that I should really dare to dive into this one .. knowing as I do that you systems guys work in a total different world to the one that we poor users work in .. but surely as administrators you must have a means to search your network(s) for all files with a particular filename and extension .. similar to what I would do in Windows when looking for a particular file over my wealth of drives and partitions. Could you not just highlight the files (only those in the appropriate directories) that are then shown .. then do a copy paste action of the required changed file to the appropriate directories .. of course whatever someone can do on a step by step action can be better mimicked by a routine which will do the work for him. It shouldn't be difficult to create even the simplest of routines to do this function especially since as admin you would have rights that would bypass restrictions of the system ... I think this must be something very close to what you might call a healthy helpful virus

Share this post


Link to post
Share on other sites

there are a few simple ways !

1 simple line in the global logon script that simply says : "copy my printers.txt file from the

netlogon share to the directory on the local pc" would do the trick.

SCSA states he is a sysadmin, but he does not apply this simple standard procedure.

So my best guess is there is a reason, i do not doubt his technical skills : what i think is there's

a reason he cannot express clearly.

That in turn causes the communication problem why this thread is turning out so strange.

Imho his goal is simple : spread the printers.txt to all users, to a fixed spot on the client pc.

This may not be the best approach to transparently communicate all printers to users - but

he is not asking for the best way to do this.

That is why i suspect there is a communication problem.

Share this post


Link to post
Share on other sites
SCSA is a communication problem, seeming as he refuses to acknowledge any advice already given in this thread.

:lol:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now