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
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
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
--
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
> --
>
>
>
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
> --
>
>
>
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
>> --
>>
>>
>>
Bookmarks