+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
Scripts Thread, Print Script for one specific user in Coding and Web Development; Originally Posted by mac_shinobi That's correct - which is a shame, doh I take it there is no way to ...
  1. #16

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,656
    Thank Post
    324
    Thanked 506 Times in 474 Posts
    Rep Power
    177
    Quote Originally Posted by mac_shinobi View Post
    That's correct - which is a shame, doh

    I take it there is no way to do error checking using the Case Else so that it doesnt repeatdly fire off the msgbox / wscript.echo commands
    Like what?

    [code]
    On Error GoTo AMGFIXERROR

    DOLOOPSTUFF...

    AMGFIXERROR:
    wscript.echo "AMG YOU BROKE IT"
    [code]

    That kind of thing? So it only fires off on an error message? Bit confused

    Steve

  2. #17

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,219
    Thank Post
    2,769
    Thanked 935 Times in 875 Posts
    Rep Power
    343
    Quote Originally Posted by Steve21 View Post
    Like what?

    [code]
    On Error GoTo AMGFIXERROR

    DOLOOPSTUFF...

    AMGFIXERROR:
    wscript.echo "AMG YOU BROKE IT"
    [code]

    That kind of thing? So it only fires off on an error message? Bit confused

    Steve
    Select Case variable
    Case A:
    code here
    Case B:
    Code here
    Case Else:
    On Error GoTo errHandler
    End Select

    errHandler:
    msgbox err.description & err.number etc etc

    unless you can do a case on error ??

  3. #18

    Join Date
    Sep 2008
    Posts
    1,673
    Thank Post
    310
    Thanked 221 Times in 197 Posts
    Rep Power
    107
    If it's a local printer, could you not just put a script on their computer in their startup folder which sets their local printer as default? That way the network printers should get installed and then it should overwrite the default printer with the local script.

  4. #19

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,656
    Thank Post
    324
    Thanked 506 Times in 474 Posts
    Rep Power
    177
    Quote Originally Posted by mac_shinobi View Post
    Select Case variable
    Case A:
    code here
    Case B:
    Code here
    Case Else:
    On Error GoTo errHandler
    End Select

    errHandler:
    msgbox err.description & err.number etc etc

    unless you can do a case on error ??
    Shouldn't need to, putting the "on error" will follow the code below it, so doing it before the case statement will still fire it off, or should do

    Steve

  5. #20

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,219
    Thank Post
    2,769
    Thanked 935 Times in 875 Posts
    Rep Power
    343
    Quote Originally Posted by Steve21 View Post
    Shouldn't need to, putting the "on error" will follow the code below it, so doing it before the case statement will still fire it off, or should do

    Steve
    I couldn't get the on error thing to work, tried

    On Error GoTo errHandler

    loop code and any other code

    errHandler:

    msgbox "An error occured with description of " & err.description & " Error Number : " & err.Number

    I tried wscript.echo instead of msgbox, it showed me the error number but err.description was null / blank

    Tried the code you posted above with the same Case Else : On Error GoTo errHandler or whatever the tag was for handling errors and didn't work.

    I tried using On Error Resume Next and also did an err.Clear or err.Raise etc

    An example dummy script would be good if you get a few mins just so I can see the error handling actually working.

  6. #21

    john's Avatar
    Join Date
    Sep 2005
    Location
    London
    Posts
    10,439
    Thank Post
    1,468
    Thanked 1,035 Times in 908 Posts
    Rep Power
    299
    Wow so much discussion over a simple script!!

    I haven't had 10 minutes to remotely logon to the users PC to check but on my test system here it works great but will drop you a note Steve if it has any moments Cheers all for the suggestions and advice and pointers

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Want to set a profile for one specific student
    By speckytecky in forum Windows Server 2008
    Replies: 2
    Last Post: 1st September 2011, 02:55 PM
  2. one specific user profile could not load properly,
    By lionsl2005 in forum Windows Server 2008
    Replies: 1
    Last Post: 5th July 2010, 01:46 PM
  3. logon script to map specific user to share
    By techie211 in forum Scripts
    Replies: 3
    Last Post: 28th December 2009, 04:50 PM
  4. Active Directory-Script for Creating Bulk Users
    By calapso in forum How do you do....it?
    Replies: 8
    Last Post: 14th January 2009, 06:32 PM
  5. Make a script run for SINGLE domain user
    By philtomo-25 in forum How do you do....it?
    Replies: 5
    Last Post: 15th November 2007, 09:21 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
  •