+ Post New Thread
Results 1 to 3 of 3
How do you do....it? Thread, Multiple Values In Case KixStart Statement in Technical; We have a KixStart script which allocates printers based on station name. For the Library we have: CASE LEFT(@WKSTA, 3) ...
  1. #1

    DaveP's Avatar
    Join Date
    Oct 2006
    Location
    Can't talk now: The mother-ship is calling!
    Posts
    9,372
    Thank Post
    354
    Thanked 1,349 Times in 927 Posts
    Blog Entries
    4
    Rep Power
    1203

    Multiple Values In Case KixStart Statement

    We have a KixStart script which allocates printers based on station name. For the Library we have:

    CASE LEFT(@WKSTA, 3) = "lib"
    AddPrinterConnection ("\\Server\Library")
    SetDefaultPrinter ("\\Server\Library")


    This works very well. However I have a need to allocate the same printer[s] to multiple stations:

    CASE LEFT(@WKSTA, 5) = "eng01","eng02","eng03"
    AddPrinterConnection ("\\Server\English")
    SetDefaultPrinter ("\\Server\English")

    To achieve the same result I currently have to use:

    CASE LEFT(@WKSTA, 5) = "eng01"
    AddPrinterConnection ("\\Server\English")
    SetDefaultPrinter ("\\Server\English")

    CASE LEFT(@WKSTA, 5) = "eng02"
    AddPrinterConnection ("\\Server\English")
    SetDefaultPrinter ("\\Server\English")

    CASE LEFT(@WKSTA, 5) = "eng03"
    AddPrinterConnection ("\\Server\English")
    SetDefaultPrinter ("\\Server\English")


    I am beginning to think that my KixStart syntax is incorrect. Can anyone suggest what the correct syntax should be?

    BTW: I know I could use:

    CASE LEFT(@WKSTA, 3) = "eng"
    AddPrinterConnection ("\\Server\Library")
    SetDefaultPrinter ("\\Server\Library")


    but not all of the stations with similar names always get pointed to the same printer (eg: Eng04 may want to use Science and Admin printers for reasons of proximity to the printer[s])

    TIA.

  2. #2

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,159
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    125
    You really want to make sure that the machine names have unique stems which are the same length (whether that's 3 or 5 or whatever characters) and then you can do something like:
    Code:
    $stem=LEFT(@WKSTA, 5)
    select
      case $stem="ENG01" or $room="ENG02"
       $printer="\\Server\English"
      case $stem="LIBRA"
       $printer="\\server2\library"
      case $stem="MATH0" or $room="MATH2"
       $printer="\\server\maths"
    endselect
    
    AddPrinterConnection ($printer)
    SetDefaultPrinter ($printer)
    If you can't do that, can you find the OU the machines are in and use that as your identifier to determine the printer?

  3. #3

    DaveP's Avatar
    Join Date
    Oct 2006
    Location
    Can't talk now: The mother-ship is calling!
    Posts
    9,372
    Thank Post
    354
    Thanked 1,349 Times in 927 Posts
    Blog Entries
    4
    Rep Power
    1203
    Quote Originally Posted by srochford View Post
    You really want to make sure that the machine names have unique stems....
    Station names are not wholly within my gift [Our network is part of a Consortium and for various reasons I am not able to name stations as I would like at the moment. That will change later. For now I have to suffer the limitations of the current naming scheme]

    Quote Originally Posted by srochford View Post
    If you can't do that, can you find the OU the machines are in and use that as your identifier to determine the printer?
    I am using the OU to determine which printers Students get which is not always the printers Staff require in the same rooms: Our MFL department want to print back to their office when they logon but they also want students to print to the classroom based stations.

    I will look at your coding suggestion: Perhaps I can adapt my script around the method described by you in your post.



SHARE:
+ Post New Thread

Similar Threads

  1. Compare Values Above, Equal and Below
    By TwyloII in forum How do you do....it?
    Replies: 7
    Last Post: 16th January 2009, 01:20 PM
  2. CV personal statement section
    By ITWombat in forum Educational IT Jobs
    Replies: 16
    Last Post: 17th June 2008, 07:35 AM
  3. Best Mission Statement Words
    By blackcat in forum General Chat
    Replies: 10
    Last Post: 22nd December 2007, 11:30 AM
  4. Vision Statement
    By paulpmp4 in forum Virtual Learning Platforms
    Replies: 5
    Last Post: 29th October 2007, 11:50 AM
  5. Excel IF statement maybe VB
    By danIT in forum General Chat
    Replies: 1
    Last Post: 5th January 2007, 01:12 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •