Printer Script... what does this part do?




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

.



Relevant Pages

  • Re: pushprinterconnection.exe
    ... You said you used a startup script right? ... Since startup scripts (versus ... In the Group Policy Object Editor: ... Logged on as administrator and didn't get the assigned printers. ...
    (microsoft.public.windows.group_policy)
  • Re: pushprinterconnection.exe
    ... setting in group policy (not startup scripts): ... In the Group Policy Object Editor: ... Logged on as administrator and didn't get the assigned printers. ... Does GPO deployment work under that scenario? ...
    (microsoft.public.windows.group_policy)
  • Re: PLEASE EVALUATE THIS SCRIPT INSTEAD Re: Please evaluate logon script
    ... The scripts are at work, I'll copy and send them tomorrow ... our network is up 99%. ... drives and printers. ... so I can display the default and all printers available to ...
    (microsoft.public.scripting.vbscript)
  • Re: Mapping a drive
    ... thanks for the idea on the printers. ... Jim ... > connection is made to the right share. ... > I also connect to printers in CMD scripts using the following command ...
    (microsoft.public.windows.group_policy)
  • Re: Running Login Scripts on XP using NT 4.0 Netlogon
    ... The scripts are working at least far enough into them to ... Printers are an issue. ... that you specify to install printer drivers. ... > the Win 98 clients. ...
    (microsoft.public.windowsxp.security_admin)

Quantcast