Poll: Was this script helpful?

Be advised that this is a public poll: other users can see the choice(s) you selected.

+ Post New Thread
Page 6 of 11 FirstFirst ... 2345678910 ... LastLast
Results 76 to 90 of 165
Scripts Thread, A Printer Script in Coding and Web Development; Thanks Ric, At the moment I have around 6 rooms all setup great in the script. I have setup to ...
  1. #76
    mullet_man's Avatar
    Join Date
    Oct 2005
    Location
    Oldham
    Posts
    740
    Thank Post
    35
    Thanked 48 Times in 46 Posts
    Rep Power
    28

    Re: A Printer Script

    Thanks Ric,

    At the moment I have around 6 rooms all setup great in the script.

    I have setup to the 3 letter inspect.

    I have two rooms one called RM2 (pcs called RM2-01 etc) and another called RM15 (pcs called RM15-01 etc)

    So the script picks it up ok, but in Science we have laptops named S-01 to S-30, so I cant use S- as that is 2 letters.

    And if I bring the inspect down to 2 letters it would pick up RM2 and RM15 as the same rooms?

    If I could use a split how would I put that in? I am very limited when it comes to scripting.

    Thanks and hope that makes more sense!

    Ste.

  2. #77
    mullet_man's Avatar
    Join Date
    Oct 2005
    Location
    Oldham
    Posts
    740
    Thank Post
    35
    Thanked 48 Times in 46 Posts
    Rep Power
    28

    Re: A Printer Script

    Hi Ric,

    How would I implement the split?, looking at the script I would need to have two different inspects to help with the science laptops.

    Thanks in advance.

  3. #78

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: A Printer Script

    Well you could nest it in the RM case

    Code:
    Select Case (Left(computerName, 1))
    	Case "r"
    	            Select Case (Left(computerName, 3)	
                                    Case "rm1"
                                             'RM15 stuff here
                                    Case "rm2"
                                              'RM2 stuff here
                                     Case Else
                                              'catch all for anything else called 'RXXXXX
                        End Select
          Case "s"
                    'S- stuff here

  4. #79

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    10,052
    Thank Post
    3,583
    Thanked 1,123 Times in 1,025 Posts
    Rep Power
    377

    Re: A Printer Script

    It would be something along the lines of :

    Dim x, strComputer

    x = split(strComputer,"-")

    Select Case x(0) '<-- change the value in between the brackets

    Case "RM01"
    wshnetwork.AddwindowsPrinterConnection

    Case "RM02"
    wshnetwork.AddwindowsPrinterConnection

    End Select


    if you change the value in between the brackets for x(0) or x(1) then it will return the characters before or after the split character which in this case is the hyphen because your computer names all have RM01-01 or RM15-02 or whatever which is a common character so we use the common character to split the string.

  5. #80
    mullet_man's Avatar
    Join Date
    Oct 2005
    Location
    Oldham
    Posts
    740
    Thank Post
    35
    Thanked 48 Times in 46 Posts
    Rep Power
    28

    Re: A Printer Script

    Thanks Geoff

    That worked great

  6. #81
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    16

    Re: A Printer Script

    Would this script work with Thinstation clients? They connect using the GUID that AD sets them, but presumably I can set their client name somewhere so that it reflects the room they are in?

    If that is the case then how would I run this script on a thinclient?

  7. #82
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    16

    Re: A Printer Script

    Bump?

  8. #83

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: A Printer Script

    What are you using server side for your thinstation clients? Citrix? Terminal Server? Something else?

  9. #84
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    16

    Re: A Printer Script

    Terminal Server

  10. #85

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    Boston, MA
    Posts
    7,601
    Thank Post
    110
    Thanked 771 Times in 599 Posts
    Rep Power
    183

    Re: A Printer Script

    Indeed it does work on ThinStation (as I use it on ThinStation).

    You need to give your machines sensible names in the thinstation.hosts file... something similar to this will do:

    Code:
    # HOST      MAC            GROUPS               COMMENTS
    #donald      003103014152   it_kb hi_res         # Donald Ducks Computer
    
    RM1-PC01	0050044716AB
    RM1-PC02	0007E996B6B6
    
    RM2-PC69	000BDB56E8A3
    You then just run the script as a login script and Bob's your uncle

  11. #86

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: A Printer Script

    Are your thinstations pushing out unique %CLIENTNAME%'s?

  12. #87
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    16

    Re: A Printer Script

    I see, thanks Ric. Now this is probably a stupid question (it's Monday) but do I run it in the usual user login script? Won't this then run on all stations slowing the logon?

    Geoff, I believe they are yes, but I will need to check first.

    I apologise if I'm being slow

  13. #88

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227

    Re: A Printer Script

    The script runs on the terminal server.

  14. #89
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    16

    Re: A Printer Script

    Do you mean to set it in the Environment tab of the Terminal Server Config?

  15. #90
    Andi's Avatar
    Join Date
    Feb 2007
    Location
    Newport, South Wales
    Posts
    276
    Thank Post
    52
    Thanked 4 Times in 4 Posts
    Rep Power
    16

    Re: A Printer Script

    Actually scratch that, I've just found this page for the login script section.

    http://support.microsoft.com/kb/195461



SHARE:
+ Post New Thread
Page 6 of 11 FirstFirst ... 2345678910 ... LastLast

Similar Threads

  1. logon script for printer
    By ozzy in forum Scripts
    Replies: 6
    Last Post: 22nd November 2007, 04:03 PM
  2. Printer Script
    By faza in forum Scripts
    Replies: 9
    Last Post: 14th September 2007, 09:30 AM
  3. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 12:00 PM
  4. Add printer script not workling
    By mark in forum Windows
    Replies: 6
    Last Post: 15th September 2005, 11:07 AM
  5. Script to delete printer
    By tosca925 in forum Scripts
    Replies: 2
    Last Post: 31st August 2005, 08:45 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
  •