Here is my 2 cents. I tried to install and share printers but it did not
work with VBscript. Not sure what I was doing wrong, but it never seemed to
work. I finally got it to work using rundll32.
The examples show in previous post show how to share, not install printers.
Below are examples of what I use in some login scripts using rundll32 to
share printers, but you can also use this with the correct switches to
install printers. If you type the following at the command line you will
get a printer user interface help window with all kinds of help and switch
descriptions.
rundll32 printui.dll,PrintUIEntry /?
Here are my examples.......
::delete the current s200 printer
rundll32 printui.dll,PrintUIEntry /dl /q /n s200
::create the shared printer
rundll32 printui.dll,PrintUIEntry /in /q /n \\Sevier-pdc\HP4050-S200-Out
::wait for shared printer to be created
timeout 6
::make the created shared printer the default printer
rundll32 printui.dll,PrintUIEntry /y /q /n \\Sevier-pdc\HP4050-S200-Out
HTH
Joe Sargent
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Benjamin Winzenz
Sent: Friday, February 08, 2002 10:02 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [ActiveDir] Default Printer
OK - I'll post it to this list as well. You don't map a network printer to
a local LPT port. That is all sorts of wrong. Try running this script.
Copy these lines to your favorite text editor and save it as a .vbs file.
Run it and replace the obvious servername\printershare with your print
server and the printer share name.
DIM Network
Set Network = CreateObject("Wscript.Network")
Network.AddWindowsPrinterConnection "\\servername\printershare"
Network.SetDefaultPrinter "\\servername\printershare"
Ben Winzenz, MCSE
Network/Systems Administrator
Peregrine Systems
-----Original Message-----
From: Morgan, Joshua [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 4:46 PM
To: 'NT 2000 Discussions'
Cc: '[EMAIL PROTECTED]'
Subject: RE: [ActiveDir] Default Printer
Ok Larry or anybody else
I read the manual and entered this into my script:
Set WshNetwork = WScript.CreateObject("WScript.Network")
' Map Printers Common to all users
WshNetwork.AddPrinterConnection "LPT2", "\\servername\tigger"
WshNetwork.SetDefaultPrinter "\\servername\tigger"
When I run the script I get this error:
C:\LoginScripts\NetAdmin.vbs(16, 1) WSHNetwork.SetDefaultPrinter: There is
no pr
inter called "\\servername\tigger".
However I am able to \\servername\tigger and connect
Any ideas
Joshua Morgan
[EMAIL PROTECTED]
-----Original Message-----
From: Larry A. Duncan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 3:21 PM
To: NT 2000 Discussions
Subject: RE: Default Printer
Come on, Josh. I gave you what you needed. Now, go RTFM! :)
http://www.google.com/search?hl=en&q=WSH+AddPrinterConnection
http://msdn.microsoft.com/scripting
Larry A. Duncan
Field Systems Engineer, Southeast Region
Altiris Inc.
[EMAIL PROTECTED]
T: 615.599.5031
T: 800.869.9747
F: 615.599.5259
Have you maximized your investment in SMS, MOM and other Windows Mgmt tools?
Get expert answers, hands-on training, and great utilities at the Microsoft
Management Summit. Register today at http://www.altiris.com/aem/mmsconf2002/
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Morgan, Joshua
Sent: Thursday, February 07, 2002 2:03 PM
To: NT 2000 Discussions
Subject: RE: Default Printer
Any help with calling the methods would be appreciated.
Joshua Morgan
PH: (864) 250-1350 Ext 133
Fax: (413) 581-4936
[EMAIL PROTECTED]
-----Original Message-----
From: Larry A. Duncan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 2:53 PM
To: NT 2000 Discussions
Subject: RE: Default Printer
Use the WSH AddPrinterConnection method, followed by the SetDefaultPrinter
method. It'd all take about 4 lines of code.
Larry A. Duncan
Field Systems Engineer, Southeast Region
Altiris Inc.
[EMAIL PROTECTED]
T: 615.599.5031
T: 800.869.9747
F: 615.599.5259
Have you maximized your investment in SMS, MOM and other Windows Mgmt tools?
Get expert answers, hands-on training, and great utilities at the Microsoft
Management Summit. Register today at http://www.altiris.com/aem/mmsconf2002/
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Morgan, Joshua
Sent: Thursday, February 07, 2002 1:32 PM
To: NT 2000 Discussions
Subject: Default Printer
I saw the postings about con2prt but I was wondering if anyone new how to
install printers using a Vbscript and then automatically set a printer to be
default
Joshua Morgan
PROFITLAB
Network Engineer
[EMAIL PROTECTED]
"One is glad to be of service "
--Robin Williams (Bicentennial Man)--
------
You are subscribed as [EMAIL PROTECTED]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.320 / Virus Database: 179 - Release Date: 1/30/2002
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.320 / Virus Database: 179 - Release Date: 1/30/2002
------
You are subscribed as [EMAIL PROTECTED]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to [EMAIL PROTECTED]
------
You are subscribed as [EMAIL PROTECTED]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.320 / Virus Database: 179 - Release Date: 1/30/2002
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.320 / Virus Database: 179 - Release Date: 1/30/2002
------
You are subscribed as [EMAIL PROTECTED]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to [EMAIL PROTECTED]
List info : http://www.activedir.org/mail_list.htm
List FAQ : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
List info : http://www.activedir.org/mail_list.htm
List FAQ : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
List info : http://www.activedir.org/mail_list.htm
List FAQ : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/