|
Exactly as the others have said. You can't make a
single variable hold two different connect strings... You can re-assign
the strConnectString variable each time and then call the
wshNetwork.AddWindowsPrinterConnection as such...
Set objWSHNetwork =
CreateObject("WScript.Network") 'create network object strConnectString = "\\servername\Boston_IT2"
strConnectString = "\\servername\Boston_IT"
----
To add
or remove printers, just add another line of strConnectString.add
"_PrinterName_", "_PrinterConnectString_"
Just
replace the PrinterName (anything you want to call it, so long as it's not the
same as any other) and PrinterConnectString with appropriate
values.
Joe
Pochedley From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Sullivan Sent: Tuesday, April 12, 2005 4:55 PM To: [email protected] Subject: RE: [ActiveDir] VB Script and Group policy strConnectString is
only going to carry one value to the strResult… You need to create a
loop or do it one at a time. Also not a VBScript person but
maybe Set wshNetwork =
CreateObject("WScript.Network") wshNetwork.AddWindowsPrinterConnection
"\\2k3dc\HP6" Set wshNetwork =
CreateObject("WScript.network") wshNetwork.AddWindowsPrinterconnection
\\2k3dc\HPSales Setup each printer as
a separate section. The problem is apparently that your
AddWindowsPrinterConnections usees strConnectString and you are expecting it to
hold two strings… it only holds one. So your second strConnectString line
essentially overwrites the first. I think this is right.. It may not be the
‘best’ way to do it but it should work… Kevin From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Christine
Allen Running Windows 2000
AD I'm looking to automate the
installation of printers using a vb script and group policy. I found
the script referenced below which works great for adding the printer and works
great with GP. However, I can only add one printer. Every time I
modify it to add additional printers it only adds
one. Set objWSHNetwork =
CreateObject("WScript.Network") 'create network object Does anyone out there know a way of
additional multiple printers with this script? I should mention I am not a
vb person. Thanks |
- [ActiveDir] VB Script and Group policy Christine Allen
- RE: [ActiveDir] VB Script and Group policy Fuller, Stuart
- RE: [ActiveDir] VB Script and Group policy Kevin Sullivan
- RE: [ActiveDir] VB Script and Group policy Thorbj�rn Sj�vold
- RE: [ActiveDir] VB Script and Group policy Mulnick, Al
- RE: [ActiveDir] VB Script and Group policy Joe Pochedley
- RE: [ActiveDir] VB Script and Group policy Christine Allen
