Printer Script... what does this part do?
- From: gshaw <gshaw.2u80fh@xxxxxxxxxxxxx>
- Date: Tue, 24 Jul 2007 15:34:09 +0530
Hi,
We've been migrating our printers over to a new server recently and
while editing the scripts to point to the new paths I've seen part of
it I don't understand...
==========================================================
' VBScript.
on error resume next
Set net = WScript.CreateObject("wscript.network")
SET PRINTERS = NET.ENUMPRINTERCONNECTIONS
FOR LOOP_COUNTER = 0 TO PRINTERS.COUNT - 1 STEP 2
'MSGBOX PRINTERS(LOOP_COUNTER) & VBTAB & PRINTERS(LOOP_COUNTER + 1)
NET.REMOVEPRINTERCONNECTION PRINTERS(LOOP_COUNTER + 1)
NET.REMOVEPRINTERCONNECTION PRINTERS(LOOP_COUNTER)
NEXT
Set Printers = Nothing
net.AddWindowsPrinterConnection "\\server\printer1"
net.AddWindowsPrinterConnection "\\server\printer2"
net.SetDefaultPrinter "\\grs-appserv03\\\server\printer1"
==========================================================
It's the bit in bold I'm unsure of? Also since the migration the
printers have been playing up, I suspect dodgy HP drivers but also the
scripts don't seem to be running properly.
Using rsop.msc the group policy has applied the script yet nothing
happens on logon, sometimes the script might run after 5-10 minutes but
other times nothing happens at all, any ideas?
Thanks in advance,
Gerrard Shaw
--
gshaw
------------------------------------------------------------------------
gshaw's Profile: http://forums.techarena.in/member.php?userid=28430
View this thread: http://forums.techarena.in/showthread.php?t=788880
http://forums.techarena.in
.
- Follow-Ups:
- Re: Printer Script... what does this part do?
- From: Vinicius Canto [MVP]
- Re: Printer Script... what does this part do?
- Prev by Date: Script folder permissions change
- Next by Date: Re: list group membership
- Previous by thread: Script folder permissions change
- Next by thread: Re: Printer Script... what does this part do?
- Index(es):
Relevant Pages
|