+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 39
Learning Network Manager Thread, Network Printing in Technical; Code: on error resume next Set WshNetwork = CreateObject("WScript.Network") Dim Compname Compname = WSHNetwork.ComputerName if left(compname,8) = "JNRCLASS" then PrinterPath ...
  1. #16

    Little-Miss's Avatar
    Join Date
    Oct 2007
    Location
    Birmingham
    Posts
    5,348
    Thank Post
    2,330
    Thanked 622 Times in 418 Posts
    Blog Entries
    2
    Rep Power
    508
    Code:
    on error resume next
    
    Set WshNetwork = CreateObject("WScript.Network")
    
    Dim Compname
    
    Compname = WSHNetwork.ComputerName
    
    if left(compname,8) = "JNRCLASS" then 
    
    	PrinterPath = "\\curricsvr1\JUNIOR-SUITE"
    	PrinterPath2 = "\\curricsvr1\LIBRARY"
    	
      	WshNetwork.AddwindowsPrinterConnection PrinterPath
      	WshNetwork.AddwindowsPrinterConnection PrinterPath2
    	WshNetwork.SetDefaultPrinter "\\curricsvr1\LIBRARY"
    
    end if
    and so on and so on....

  2. #17

    Join Date
    Dec 2009
    Posts
    592
    Thank Post
    8
    Thanked 36 Times in 34 Posts
    Rep Power
    16
    are the new printer shares the same as the old brand of printer ( same port etc ) ? if so it might be getting a tad confused .. try a different ip for the printers and a different share name

    Enable Loopback so you can assign the printers by OU

    heres my script i use to add first remove old printers then add some new ones
    ON ERROR RESUME NEXT

    Set WshNetwork = WScript.CreateObject("WScript.Network")

    'Remove old printers
    WshNetwork.RemovePrinterConnection "\\SERVER\MusicBWLaser", True, True

    'Install new Printers
    WshNetwork.AddWindowsPrinterConnection "\\SERVER\MusicBWLaser"

    'set default Printer
    WshNetwork.SetDefaultPrinter "\\SERVER\MusicBWLaser"

    'Clean Up Memory Used
    Set WshNetwork = Nothing

    wscript.quit

  3. Thanks to 2097 from:

    Little-Miss (20th January 2011)

  4. #18

    Little-Miss's Avatar
    Join Date
    Oct 2007
    Location
    Birmingham
    Posts
    5,348
    Thank Post
    2,330
    Thanked 622 Times in 418 Posts
    Blog Entries
    2
    Rep Power
    508
    Yeah, starting to think it was a bad idea literally replacing the printers and not changing share names or IP's
    Without messing with assigning printers to OU's at the moment. Is there a way i could add that to my current VBs script?

  5. #19

    teejay's Avatar
    Join Date
    Apr 2008
    Posts
    3,051
    Thank Post
    275
    Thanked 722 Times in 550 Posts
    Rep Power
    326
    There is a much simpler way with 2003/XP to map printers rather than Group Policy or login scripts. This remotely adds a network printer to a machine permanently (well, unlees the machine is re-imaged or the delete cmd is run). Just create a batch file as per example attached and run it once, see attached zip file.
    Attached Files Attached Files

  6. Thanks to teejay from:

    Little-Miss (20th January 2011)

  7. #20

    Little-Miss's Avatar
    Join Date
    Oct 2007
    Location
    Birmingham
    Posts
    5,348
    Thank Post
    2,330
    Thanked 622 Times in 418 Posts
    Blog Entries
    2
    Rep Power
    508
    Very cool Teejay.

    As a quick fix, would renaming the printers help? For example ive got STAFF-ROOM, would changing it to STAFF ROOM help?

  8. #21

    teejay's Avatar
    Join Date
    Apr 2008
    Posts
    3,051
    Thank Post
    275
    Thanked 722 Times in 550 Posts
    Rep Power
    326
    Should do, but I would avoid using spaces in printer names.

  9. #22

    Little-Miss's Avatar
    Join Date
    Oct 2007
    Location
    Birmingham
    Posts
    5,348
    Thank Post
    2,330
    Thanked 622 Times in 418 Posts
    Blog Entries
    2
    Rep Power
    508
    Ah ok....underscore it is then!

  10. #23

    teejay's Avatar
    Join Date
    Apr 2008
    Posts
    3,051
    Thank Post
    275
    Thanked 722 Times in 550 Posts
    Rep Power
    326
    Your being too kind to staff, call it something like KY27MFP ;-)

  11. #24

    Little-Miss's Avatar
    Join Date
    Oct 2007
    Location
    Birmingham
    Posts
    5,348
    Thank Post
    2,330
    Thanked 622 Times in 418 Posts
    Blog Entries
    2
    Rep Power
    508
    lol! Noooo, i'm making my life easier cus this way i dont have to talk to them to explain which printer is which!!!

  12. #25

    Join Date
    Dec 2009
    Posts
    592
    Thank Post
    8
    Thanked 36 Times in 34 Posts
    Rep Power
    16
    maybe StaffroomBW or StaffroomColour

    i like to label them like that to stop them sending stuff to the wrong one..

    id suggest using loopback processing and assigning printers by Computer OU

    Its a lot easier

    I have never had printer or driver problems .. apart from the occasional fudge up when something gets stuck

    I also really think this is a sharename/IP problem so give the printer a new IP and create a new port for it .. and change the sharename.

  13. #26

    teejay's Avatar
    Join Date
    Apr 2008
    Posts
    3,051
    Thank Post
    275
    Thanked 722 Times in 550 Posts
    Rep Power
    326
    You know they'll just send everything to the default printer anyway, then try printing it another 5-10 times when it doesn't magically appear from the printer nearest to them ;-)

  14. #27

    Little-Miss's Avatar
    Join Date
    Oct 2007
    Location
    Birmingham
    Posts
    5,348
    Thank Post
    2,330
    Thanked 622 Times in 418 Posts
    Blog Entries
    2
    Rep Power
    508
    ohhh god thats so true...

  15. #28

    teejay's Avatar
    Join Date
    Apr 2008
    Posts
    3,051
    Thank Post
    275
    Thanked 722 Times in 550 Posts
    Rep Power
    326
    I must patent a device that can be installed in teachers/students (where it's installed, use your imagination) that monitors their exact location in school and redirects printing to the nearest printer.

  16. #29

    Join Date
    Dec 2009
    Posts
    592
    Thank Post
    8
    Thanked 36 Times in 34 Posts
    Rep Power
    16
    Quote Originally Posted by teejay View Post
    I must patent a device that can be installed in teachers/students (where it's installed, use your imagination) that monitors their exact location in school and redirects printing to the nearest printer.
    LOL

    How about
    Loop Back enabled .
    Multiple OU's for Rooms dependant on the location of the nearest printer
    then my script above to do it

    for e.g.
    Room 1 has 2 printers
    I create two OU's called Room1a and room1b

    all the pcs nearest to printer 1 gots in room1a
    all the pcs nearest to printer 2 goes in room1b

    different printer scripts setting the default printer in each OU

    See ive beaten you to it .

  17. #30

    teejay's Avatar
    Join Date
    Apr 2008
    Posts
    3,051
    Thank Post
    275
    Thanked 722 Times in 550 Posts
    Rep Power
    326
    Yes that works for static PC's, so does the utility I posted. The problem is laptops when they move around to different rooms, so I still need to patent my device

SHARE:
+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Canon Photocopier - Network Printing
    By Iain.Faulkner in forum Windows Server 2008
    Replies: 33
    Last Post: 28th February 2012, 10:10 AM
  2. Network Printing
    By witch in forum Windows
    Replies: 9
    Last Post: 28th December 2008, 12:50 PM
  3. Monitoring network printing
    By Trav in forum Windows
    Replies: 35
    Last Post: 31st July 2007, 05:17 PM
  4. Network Printing Problem
    By SpuffMonkey in forum Windows
    Replies: 6
    Last Post: 9th January 2006, 07:47 PM
  5. Network Printing
    By ninjabeaver in forum Windows
    Replies: 26
    Last Post: 22nd August 2005, 08:28 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
  •