+ Post New Thread
Results 1 to 2 of 2
Scripts Thread, Script to change printer server in Coding and Web Development; I need a script which can delete an old printer connection, then re-install the printer to a new server path. ...
  1. #1
    button_ripple's Avatar
    Join Date
    Dec 2007
    Location
    Luton
    Posts
    346
    Thank Post
    93
    Thanked 20 Times in 18 Posts
    Rep Power
    18

    Script to change printer server

    I need a script which can delete an old printer connection, then re-install the printer to a new server path. Can anyone help me with this?

  2. #2

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,689
    Thank Post
    756
    Thanked 1,715 Times in 1,526 Posts
    Rep Power
    438
    'Remove ALL old printers
    'Enumerate all printers first, after that you can select the printers you want by performing some string checks
    Set WSHPrinters = WNet.EnumPrinterConnections
    For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2
    'To remove only networked printers use this If Statement
    If Left(WSHPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then
    WNet.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True
    End If
    'To remove all printers incuding LOCAL printers use this statement and comment out the If Statement above
    'WNet.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True
    Next
    'end delete existing printers

  3. Thanks to plexer from:

    button_ripple (16th September 2008)



SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 13
    Last Post: 20th February 2008, 05:29 PM
  2. Script to change folder permissions
    By scottyses in forum General Chat
    Replies: 1
    Last Post: 15th January 2008, 09:52 AM
  3. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 12:00 PM
  4. Script To Change A Registry Key
    By DaveP in forum Windows
    Replies: 6
    Last Post: 7th March 2007, 01:57 PM
  5. Change network printer default setting
    By speckytecky in forum Wireless Networks
    Replies: 1
    Last Post: 31st May 2006, 07:44 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
  •