+ Post New Thread
Results 1 to 6 of 6
Windows 7 Thread, Win7 scripted printers strange fault in Technical; ...
  1. #1

    Join Date
    Nov 2011
    Location
    Darlington
    Posts
    3
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Question Win7 scripted printers strange fault

    Hi all,

    Hope someone can help with this as its driving me crazy.

    We have a Windows 7 vanilla network mapping printers via a logon script, even though it’s stated in the script to remove all printers before it adds another it only works when we manually run it, seems to half run when used as a logon script.

    For i = 0 to Printers.Count - 1 Step 2
    If Left(ucase(Printers.Item(i+1)),2) = "\\" Then
    ' WScript.Echo Printers.Item(i+1)
    WSHNetwork.RemovePrinterConnection Printers.Item(i+1)
    End IF
    Next

    csname = left(cname,3)
    'msgbox csname
    mylprinter = ""
    Select Case csname
    case "LRC", "LRS"
    myprinter = “\\printserver\LRC-Kyocera”

    So after the users log on to a few different areas they have a bloated choice of printers but the scripted printer for the area is defaulted.

    The printers are stored in the profiles, if we reset them printers disappear but they start collecting again. We have followed the best practices for printers and GPO profiles and redirections.

    Thinking about using the GPO way via users as it allows you to add a remove all option followed by add printer, but am expecting that to accumulate printers in the same way.

    Any help appreciated.

    Thanks

  2. #2

    Join Date
    Nov 2011
    Location
    Cambridgeshire
    Posts
    561
    Thank Post
    158
    Thanked 81 Times in 71 Posts
    Rep Power
    25
    Hi. This is probably too late, but I'd definitely recommend giving GPO printer deployment a go. We have Kyocera printers and were having weird things happen with log on scripts. I'm still not sure why they weren't happy, but I changed to GPO everything's working now, so it's not top of my list to work it out.

    There's another post on here asking whether we'd recommend Kyocera printers and quite a few people have mentioned strange goings on.

    Good luck

  3. Thanks to jmak from:

    Leon377 (10th July 2012)

  4. #3
    kearton's Avatar
    Join Date
    May 2007
    Location
    Yorkshire, via NZ ;)
    Posts
    908
    Thank Post
    178
    Thanked 119 Times in 96 Posts
    Rep Power
    49
    con2prt.exe /f is handy for removing network printers (e.g in logout script)

  5. Thanks to kearton from:

    Leon377 (10th July 2012)

  6. #4

    Join Date
    Nov 2011
    Location
    Darlington
    Posts
    3
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks will give them both a try and report back.

  7. #5
    Duke5A's Avatar
    Join Date
    Jul 2010
    Posts
    859
    Thank Post
    88
    Thanked 154 Times in 124 Posts
    Blog Entries
    8
    Rep Power
    35
    I use the following code in our VB logon script with no issues whatsoever in Windows 7. As far as your own script only working if you run by hand might have something to do with UAC though.

    Code:
    	Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
    	Set colInstalledPrinters = objWMIService.ExecQuery("Select * from Win32_Printer",,48)
    		
    	On Error Resume Next
    		
    	For Each objPrinter in colInstalledPrinters
    		objNetwork.RemovePrinterConnection objPrinter.Name
    	Next
    	
    	If Error <> 0 Then
    		'Just catch the error, moving on
    	Else
    		'Nothing to see here folks, move along.
    	End If

  8. Thanks to Duke5A from:

    Leon377 (10th July 2012)

  9. #6

    Join Date
    Nov 2011
    Location
    Darlington
    Posts
    3
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks, ill make a 2nd script with the above in and do some testing, UAC has been disabled as it blocked software deployment so has the firewall and sleep\hibernate.

    I am going to start some testing w gpo printers and un-linking student based gpos to see if i have inadvertently blocked removing printers or something daft like that.



SHARE:
+ Post New Thread

Similar Threads

  1. Script Printer deployment
    By agarabaghi in forum O/S Deployment
    Replies: 5
    Last Post: 27th May 2012, 05:50 PM
  2. A Printer Script
    By Ric_ in forum Scripts
    Replies: 164
    Last Post: 1st October 2010, 11:11 AM
  3. .JS Logon script – Printers randomly not connecting
    By mjgreen in forum Windows Server 2000/2003
    Replies: 9
    Last Post: 6th May 2009, 03:54 PM
  4. CC3 - Printers - Strange Problem - HELP
    By vlan2 in forum Network and Classroom Management
    Replies: 0
    Last Post: 10th August 2008, 08:49 AM
  5. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 12:00 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
  •