+ Post New Thread
Results 1 to 5 of 5
Scripts Thread, Printer Scripts in Coding and Web Development; Hi I know this has been talked about many times before but I am confused with it all. Let’s face ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,824
    Thank Post
    875
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444

    Printer Scripts

    Hi

    I know this has been talked about many times before but I am confused with it all. Let’s face it, doesn’t take much for me.

    Right here we go, we didn’t add printers to an image last time we did them so i would like to add them now via a script. I would like the script to be as simple as possible I would like it to do the following:
    - Delete Existing Network printers only
    - Add 1 or 2 printers
    - Make one printer default.

    Thank you

    Z

  2. #2

    Join Date
    Sep 2007
    Location
    United Kingdom
    Posts
    5
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Printer Scripts

    Code:
    Dim objNetwork, strPrinter
    
    strPrinter = "\\servername\printername"
    Set objNetwork = CreateObject("WScript.Network")
    
    'Adding a printer
    objNetwork.AddWindowsPrinterConnection strPrinter
    
    'Setting a default printer
    objNetwork.SetDefaultPrinter strPrinter
    
    'Removing a printer
    objNetwork.RemovePrinterConnection strPrinter
    Adding - http://msdn2.microsoft.com/en-us/library/zsdh7hkb(VS.85).aspx
    Removing - http://msdn2.microsoft.com/en-us/library/tsbh2yy7(VS.85).aspx
    Setting a default - http://msdn2.microsoft.com/en-us/library/2ccwwdct(VS.85).aspx

  3. #3

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,590
    Thank Post
    109
    Thanked 762 Times in 593 Posts
    Rep Power
    180

    Re: Printer Scripts

    This has been discussed MANY times before. Please look at the wiki for full details.

  4. #4

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,824
    Thank Post
    875
    Thanked 1,675 Times in 1,458 Posts
    Blog Entries
    12
    Rep Power
    444

    Re: Printer Scripts

    As I highlighted before Ric, I have looked but I was lost by it all so I felt opening a new thread was the best way to go.

    @arran please can you explain more? Thank You

  5. #5

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    London
    Posts
    7,590
    Thank Post
    109
    Thanked 762 Times in 593 Posts
    Rep Power
    180

    Re: Printer Scripts

    @FN-Greatermanchester: There is a great deal of discussion already in other threads... a quick browse gives me:

    http://edugeek.net/index.php?name=Fo...iewtopic&t=404
    http://edugeek.net/index.php?name=Fo...wtopic&t=13188
    http://edugeek.net/index.php?name=Fo...ewtopic&t=1586
    http://edugeek.net/index.php?name=Fo...iewtopic&t=501

    Those are all found without using the search feature.

    IMHO the wiki page is also very descriptive when it comes to this. I'm sure that if you read http://edugeekwiki.rm-charlton.net/i...ed_on_Location everything is there.

    Also try reading the MS examples at http://www.microsoft.com/technet/scr...r/default.mspx - this is where most of us learnt to do this scripting in the first place.

    <Admin bit>So you see there is no need for ANOTHER thread about this. </Admin bit>

SHARE:
+ Post New Thread

Similar Threads

  1. Printer Scripts
    By faza in forum Wireless Networks
    Replies: 3
    Last Post: 27th July 2007, 05:15 PM
  2. Replies: 6
    Last Post: 23rd June 2007, 08:44 AM
  3. Printer scripts in GPO
    By Kyle in forum How do you do....it?
    Replies: 2
    Last Post: 25th April 2007, 07:12 AM
  4. Printer Scripts
    By Gordie in forum Windows
    Replies: 1
    Last Post: 21st February 2006, 04:35 PM
  5. printer scripts again!
    By chrbb in forum Windows
    Replies: 4
    Last Post: 10th February 2006, 12:19 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
  •