|
|
|||||||
Hi all I have created a printer script that works out what workstation you are working on then sets up the printers, and the option of having your office printer to follow you about. This might be useful users who move around alot and do not have a dedicated PC. First of all I run a Computer Startup Script. ;Computer Boot-Up Printer Script ; This line sets the variable $prn to the prnfile.ini file which contains all the workstation names $prn = "\\QEH-TR\SYSVOL\QEH-TR.STHAMES.NHS.UK\Scripts\prnfile.ini" $prn1 = READPROFILESTRING("$prn", @wksta, "prn1") $prn2 = READPROFILESTRING("$prn", @wksta, "prn2") $defprn = READPROFILESTRING("$prn", @wksta, "default") open ( 1 ,"%SystemDrive%\Printers.cmd" , 5 ) writeline ( 1 , "\\QEH-TR\SYSVOL\QEH-TR.STHAMES.NHS.UK\SCRIPTS\con2prt /f " +$defprn + " " +$prn1 + " " +$prn2) close (1) That references a ini file which looks like this: [DCENTRE01] prn1 = /c \\fileprint\3341 ;prn2 = /c \\fileprint\3343 default = /cd \\fileprint\3340 [DCENTRE02] prn1 = /c \\fileprint\3341 ;prn2 = /c \\fileprint\3340 default = /cd \\fileprint\3340 [DCENTRE03] prn1 = /c \\fileprint\3341 ;prn2 = /c \\fileprint\3340 default = /cd \\fileprint\3340 Then when the user logs in, the login script will call the printers.cmd file located on the local PC and connect to the 3 nerest printers to that PC. And the as a optional script, If a user want their Office printer on the printer list I run this script. ;Home Printer Re-Direction Script $prn = @LDRIVE + "homeprn.ini" $homeprn = READPROFILESTRING("$prn", @userid, "homeprn") shell @LDRIVE + "con2prt /c " +$homeprn" That calls a ini file which looks like this. [administrator] homeprn = \\fileprint\opsptr [richard.farthing] homeprn = \\fileprint\3044 [tracy.ross] homeprn = \\fileprint\3341 I work for a Hospital, and this has worked wonders since installing. Hope it can help someone out. Richard Farthing |
||||||||
|
|
|||||||
See also code:which is part of a modular login script to be found at Modular Login Script (long post, lots of code) and is also used as part of KiXtart Systems Management Server;------------------------------------- [ 21. August 2002, 16:04: Message edited by: sealeopard ] |