Results 1 to 5 of 5

Thread: Use logon script to map network printer

  1. #1
    Mitch Guest

    Use logon script to map network printer

    What is the syntax to map a network printer from a logon script in Windows
    2003? Also, what is the syntax to map a network printer from a command line.
    Thanks.

    Mitch

  2. #2
    Richard Mueller [MVP] Guest

    Re: Use logon script to map network printer

    Mitch wrote:

    > What is the syntax to map a network printer from a logon script in Windows
    > 2003? Also, what is the syntax to map a network printer from a command
    > line.
    > Thanks.


    In VBScript:
    =======
    Set objNetwork = CreateObject("Wscript.Network")
    objNetwork.AddWindowsPrinterConnection "\\PrintServer\HPLaser2"
    objNetwork.SetDefaultPrinter "\\PrintServer\HPLaser2"
    ======
    Or, to connect to a port:

    objNetwork.AddPrinterConnection "LPT1:", "\\PrintServer\Printer3"

    From a command line (or a batch file):

    net use LPT1 \\MyServer\MyPrinter

    --
    Richard Mueller
    MVP Directory Services
    Hilltop Lab - http://www.rlmueller.net
    --



  3. #3
    Mitch Guest

    Re: Use logon script to map network printer

    Great! Thanks for the info.

    "Richard Mueller [MVP]" wrote:

    > Mitch wrote:
    >
    > > What is the syntax to map a network printer from a logon script in Windows
    > > 2003? Also, what is the syntax to map a network printer from a command
    > > line.
    > > Thanks.

    >
    > In VBScript:
    > =======
    > Set objNetwork = CreateObject("Wscript.Network")
    > objNetwork.AddWindowsPrinterConnection "\\PrintServer\HPLaser2"
    > objNetwork.SetDefaultPrinter "\\PrintServer\HPLaser2"
    > ======
    > Or, to connect to a port:
    >
    > objNetwork.AddPrinterConnection "LPT1:", "\\PrintServer\Printer3"
    >
    > From a command line (or a batch file):
    >
    > net use LPT1 \\MyServer\MyPrinter
    >
    > --
    > Richard Mueller
    > MVP Directory Services
    > Hilltop Lab - http://www.rlmueller.net
    > --
    >
    >
    >


  4. #4
    Mitch Guest

    Re: Use logon script to map network printer

    Hi,
    The printer mapping completed successfully using the command line, but it
    did not add a printer to the printing group. Any thoughts?

    "Richard Mueller [MVP]" wrote:

    > Mitch wrote:
    >
    > > What is the syntax to map a network printer from a logon script in Windows
    > > 2003? Also, what is the syntax to map a network printer from a command
    > > line.
    > > Thanks.

    >
    > In VBScript:
    > =======
    > Set objNetwork = CreateObject("Wscript.Network")
    > objNetwork.AddWindowsPrinterConnection "\\PrintServer\HPLaser2"
    > objNetwork.SetDefaultPrinter "\\PrintServer\HPLaser2"
    > ======
    > Or, to connect to a port:
    >
    > objNetwork.AddPrinterConnection "LPT1:", "\\PrintServer\Printer3"
    >
    > From a command line (or a batch file):
    >
    > net use LPT1 \\MyServer\MyPrinter
    >
    > --
    > Richard Mueller
    > MVP Directory Services
    > Hilltop Lab - http://www.rlmueller.net
    > --
    >
    >
    >


  5. #5
    Richard Mueller [MVP] Guest

    Re: Use logon script to map network printer

    This example installs a printer driver:

    http://www.microsoft.com/technet/scr.../prpovb04.mspx

    --
    Richard Mueller
    MVP Directory Services
    Hilltop Lab - http://www.rlmueller.net
    --

    "Mitch" <Mitch@discussions.microsoft.com> wrote in message
    news:EF08EC53-4E28-4BD7-A67D-73D322712A65@microsoft.com...
    > Hi,
    > The printer mapping completed successfully using the command line, but it
    > did not add a printer to the printing group. Any thoughts?
    >
    > "Richard Mueller [MVP]" wrote:
    >
    >> Mitch wrote:
    >>
    >> > What is the syntax to map a network printer from a logon script in
    >> > Windows
    >> > 2003? Also, what is the syntax to map a network printer from a command
    >> > line.
    >> > Thanks.

    >>
    >> In VBScript:
    >> =======
    >> Set objNetwork = CreateObject("Wscript.Network")
    >> objNetwork.AddWindowsPrinterConnection "\\PrintServer\HPLaser2"
    >> objNetwork.SetDefaultPrinter "\\PrintServer\HPLaser2"
    >> ======
    >> Or, to connect to a port:
    >>
    >> objNetwork.AddPrinterConnection "LPT1:", "\\PrintServer\Printer3"
    >>
    >> From a command line (or a batch file):
    >>
    >> net use LPT1 \\MyServer\MyPrinter
    >>
    >> --
    >> Richard Mueller
    >> MVP Directory Services
    >> Hilltop Lab - http://www.rlmueller.net
    >> --
    >>
    >>
    >>




Similar Threads

  1. Printer Script Issue on my Network Printer
    By loll in forum Networking & Security
    Replies: 1
    Last Post: 17-01-2011, 11:31 PM
  2. Replies: 3
    Last Post: 17-08-2010, 09:06 PM
  3. Removing and remapping network drives using logon script
    By jacobscharlene in forum Software Development
    Replies: 1
    Last Post: 17-12-2008, 03:43 PM
  4. Replies: 3
    Last Post: 23-10-2008, 06:58 AM
  5. Printer logon script doesn't work with Vista
    By Dilbert in forum Windows Vista Network
    Replies: 2
    Last Post: 30-05-2008, 07:14 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,021,132.36177 seconds with 17 queries