How do you map printers with vb?

Home Forums Scripting General Scripting How do you map printers with vb?

This topic contains 9 replies, has 4 voices, and was last updated by Avatar tacman45 15 years, 8 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • Avatar
    tacman45
    Member
    #98285

    Hi there good folk,
    I currently use a dos batch file for my scripting bit would move to the more stylish VB scripting if I could figure out how to map printers…
    An Suggestions?

    Many Thanks

    Iain Jones

    Avatar
    Dumber
    Participant
    #194277

    see example:

    Code:
    ‘ AUTHOR: Marcel Henderik
    ‘Comment: simple example to create printer connections.

    Dim Network
    Set Network = CreateObject(”Wscript.network”)
    Network.AddPrinterConnection “\serverprinter”

    Avatar
    tacman45
    Member
    #214862

    Amny Thanks Dumber

    Yoy are a champ!!!

    Iain Jones

    Avatar
    Dumber
    Participant
    #194279

    *blush* :oops:

    :wink:

    going to bed now.. it’s 1 am…. and at 6 i must get out…

    Avatar
    tacman45
    Member
    #214863

    Stupid Question…sorry…newbie

    Hi Dumber,
    Since I have cajolled you with complimets…I was curious….
    I know the answer will be hundreds of things….but could you give me some advice on other stuff i should/could put in a logon script besides the map printers and network drives?

    Thanks in Advance,

    Iain Jones

    Avatar
    Ossian
    Moderator
    #175045

    You can do anything you want to (obviously) but the most common uses of logon scripts are to:

    map network drives based on group membership or location
    map network printers (ditto)
    run particular startup applications.
    housekeeping e.g. clear temp files, old profiles etc.

    Probably plenty of other ideas out there….

    Tom

    Avatar
    Dumber
    Participant
    #194280

    I agree with ossian…
    im in a network where a lot of change must be made. changes in office, mcafee (see topic epo agent) etcetc.

    cause my users are still a local admin (not anymore when i tested all the applications and approve it) i put al those things in the loginscript. registry changes.. installing new software, updates from word templates.

    Avatar
    roksan
    Member
    #194198

    Same topic….

    How do I check if a printer connection exist on a computer ?

    Avatar
    Dumber
    Participant
    #194285

    you could use something like this:

    Code:
    on error resume next
    Set Network = CreateObject(”Wscript.network”)
    Network.SetDefaultPrinter “\serverprinter”
    If Err <> 0 Then
    WScript.Echo “printer does not exist”
    Else
    wscript.Echo “printer exist”
    end if

    or maybe better:

    Code:
    Set X = network.EnumPrinterConnections

    For Each printers In X
    WScript.Echo printers
    If printers = “\Serverprinter” Then
    WScript.Echo “printer found….”
    End If

    next

    Avatar
    roksan
    Member
    #194199

    Tnx.

    Thanks

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.