Page 1 of 1 1
Topic Options
#30838 - 2002-10-17 01:48 PM Need help adding a printer by computer name.
Brian Barnaba Offline
Fresh Scripter

Registered: 2002-07-11
Posts: 5
I need some help with the proper syntax for adding printers based on computer names. I work in a school and we use latop carts. We have six carts and a printer for every two carts. The computers are labeled by cart for example "es2lt1" is an elementary school laptop on cart two and is the first laptop on the cart. Each printer is designated to a specific two carts. My question is this. Is there a way to use the @WKSTA to add a printer to computers with the first three letters 'es3','es2',ect. Any help would be appreciated.
Top
#30839 - 2002-10-17 01:55 PM Re: Need help adding a printer by computer name.
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I'm not sure do I follow 100% but quess you want something like:
code:
$cart=left(@wksta,3)
select
case $cart="es1" or $cart="es2"
$nul=addprinterconnection("\\server\printer1")
case $cart="es3" or $cart="es4"
$nul=addprinterconnection("\\server\printer2")
case $cart="es5" or $cart="es6"
$nul=addprinterconnection("\\server\printer3")
endselect

correct?
_________________________
!

download KiXnet

Top
#30840 - 2002-10-17 04:22 PM Re: Need help adding a printer by computer name.
Brian Barnaba Offline
Fresh Scripter

Registered: 2002-07-11
Posts: 5
That did the trick. Thanks a million!
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1680 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.043 seconds in which 0.013 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org