For the longest while I have been attemtping to assemble a script to add my
network printers to Windows XP desktops. based on trial and error...I was
able to put together the following vbs script:

Set objWMIService = GetObject("winmgmts:")
sCmd = "rundll32.exe printui.dll,PrintUIEntry /if /b
""helpdesk_hpdj4000ps"" /f" _
& " L:\Drivers\Printers\XP\HPDJ4000ps\hpi4000d.inf /r" _
& " ""\\helpdesk\helpdesk_hpdj4000ps"" /m ""HP Designjet 4000ps PS3"
cmd = "control printers"
Set oShell = CreateObject("WScript.Shell")
oShell.Run sCmd, 1, True
oShell.Run cmd

sCmd = "rundll32.exe printui.dll,PrintUIEntry /if /b
""helpdesk_hp4500"" /f" _
& " L:\Drivers\Printers\XP\HPCLJ4500\hpbf232i.inf /r" _
& " ""\\helpdesk\helpdesk_hp4500"" /m ""HP Color LaserJet 4500 PCL 6"
cmd = "control printers"
Set oShell = CreateObject("WScript.Shell")
oShell.Run sCmd, 1, True
oShell.Run cmd

sCmd = "rundll32.exe printui.dll,PrintUIEntry /if /b
""helpdesk_hp4200"" /f" _
& " L:\Drivers\Printers\XP\HPLJ4200\PS\hp4200ps.inf /r" _
& " ""\\helpdesk\helpdesk_hp4200"" /m ""HP LaserJet 4200 PS"
cmd = "control printers"
Set oShell = CreateObject("WScript.Shell")
oShell.Run sCmd, 1, True
oShell.Run cmd

WScript.Echo "All network printers have been added to desktop!"

The installation itself works perfectly. However, after a few hours the
connection status changed from "Ready" to "Offine". Interesting enough,
users can print without problems although the status says "Offline".

Does anyone have any thoughts on fixing this Offline problem? Thanks a ton.

Peter.

Re: Connection to network printers by Owen

Owen
Mon Jan 28 16:34:23 CST 2008

On Jan 27, 3:39=A0pm, Peter. <Pe...@discussions.microsoft.com> wrote:
> For the longest while I have been attemtping to assemble a script to add m=
y
> network printers to Windows XP desktops. =A0based on trial and error...I w=
as
> able to put together the following vbs script:
>
> Set objWMIService =3D GetObject("winmgmts:")
> sCmd =3D "rundll32.exe printui.dll,PrintUIEntry /if /b
> =A0""helpdesk_hpdj4000ps"" /f" _
> =A0 =A0 =A0 & " L:\Drivers\Printers\XP\HPDJ4000ps\hpi4000d.inf /r" _
> =A0 =A0 =A0 & " ""\\helpdesk\helpdesk_hpdj4000ps"" /m ""HP Designjet 4000p=
s PS3"
> cmd =3D "control printers"
> Set oShell =3D CreateObject("WScript.Shell")
> oShell.Run sCmd, 1, True
> oShell.Run cmd
>
> sCmd =3D "rundll32.exe printui.dll,PrintUIEntry /if /b
> =A0""helpdesk_hp4500"" /f" _
> =A0 =A0 =A0 & " L:\Drivers\Printers\XP\HPCLJ4500\hpbf232i.inf /r" _
> =A0 =A0 =A0 & " ""\\helpdesk\helpdesk_hp4500"" /m ""HP Color LaserJet 4500=
PCL 6"
> cmd =3D "control printers"
> Set oShell =3D CreateObject("WScript.Shell")
> oShell.Run sCmd, 1, True
> oShell.Run cmd
>
> sCmd =3D "rundll32.exe printui.dll,PrintUIEntry /if /b
> =A0""helpdesk_hp4200"" /f" _
> =A0 =A0 =A0 & " L:\Drivers\Printers\XP\HPLJ4200\PS\hp4200ps.inf /r" _
> =A0 =A0 =A0 & " ""\\helpdesk\helpdesk_hp4200"" /m ""HP LaserJet 4200 PS"
> cmd =3D "control printers"
> Set oShell =3D CreateObject("WScript.Shell")
> oShell.Run sCmd, 1, True
> oShell.Run cmd
>
> WScript.Echo "All network printers have been added to desktop!"
>
> The installation itself works perfectly. =A0However, after a few hours the=

> connection status changed from "Ready" to "Offine". =A0Interesting enough,=

> users can print without problems although the status says "Offline". =A0
>
> Does anyone have any thoughts on fixing this Offline problem? =A0Thanks a =
ton.
>
> Peter. =A0 =A0

Peter, it is normal for a printer to go offline after a while. This
probably saves memory or other resources in Windows. And as you
observed you can still print to the printer.
OG

Re: Connection to network printers by Peter

Peter
Mon Jan 28 17:42:01 CST 2008

Thanks, Owen. The status never changes to Offline if installed via the
wizard.

Here are some additional details
My print server: Novell based
Tree name: Helpdesk.

When installed via the wizard, I observed the following:
Display name: "hpdj4000ps on HELPDESK"
Port: \\helpdesk\hpdj4000ps

When installed via the script I noticed the following:
Display name: hpdj4000ps
Port: \\helpdesk\hpdj4000ps.helpdesk
Changes to Offline when after I reboot my XP workstation.

Is possible that something might be wrong with the script?
As far as I have read, the /b changes the print name from "HP Designjet
4000ps PS3" to "helpdesk_hpdj4000ps"

Thanks.


"Owen Gilmore" wrote:

> On Jan 27, 3:39 pm, Peter. <Pe...@discussions.microsoft.com> wrote:
> > For the longest while I have been attemtping to assemble a script to add my
> > network printers to Windows XP desktops. based on trial and error...I was
> > able to put together the following vbs script:
> >
> > Set objWMIService = GetObject("winmgmts:")
> > sCmd = "rundll32.exe printui.dll,PrintUIEntry /if /b
> > ""helpdesk_hpdj4000ps"" /f" _
> > & " L:\Drivers\Printers\XP\HPDJ4000ps\hpi4000d.inf /r" _
> > & " ""\\helpdesk\helpdesk_hpdj4000ps"" /m ""HP Designjet 4000ps PS3"
> > cmd = "control printers"
> > Set oShell = CreateObject("WScript.Shell")
> > oShell.Run sCmd, 1, True
> > oShell.Run cmd
> >
> > sCmd = "rundll32.exe printui.dll,PrintUIEntry /if /b
> > ""helpdesk_hp4500"" /f" _
> > & " L:\Drivers\Printers\XP\HPCLJ4500\hpbf232i.inf /r" _
> > & " ""\\helpdesk\helpdesk_hp4500"" /m ""HP Color LaserJet 4500 PCL 6"
> > cmd = "control printers"
> > Set oShell = CreateObject("WScript.Shell")
> > oShell.Run sCmd, 1, True
> > oShell.Run cmd
> >
> > sCmd = "rundll32.exe printui.dll,PrintUIEntry /if /b
> > ""helpdesk_hp4200"" /f" _
> > & " L:\Drivers\Printers\XP\HPLJ4200\PS\hp4200ps.inf /r" _
> > & " ""\\helpdesk\helpdesk_hp4200"" /m ""HP LaserJet 4200 PS"
> > cmd = "control printers"
> > Set oShell = CreateObject("WScript.Shell")
> > oShell.Run sCmd, 1, True
> > oShell.Run cmd
> >
> > WScript.Echo "All network printers have been added to desktop!"
> >
> > The installation itself works perfectly. However, after a few hours the
> > connection status changed from "Ready" to "Offine". Interesting enough,
> > users can print without problems although the status says "Offline".
> >
> > Does anyone have any thoughts on fixing this Offline problem? Thanks a ton.
> >
> > Peter.
>
> Peter, it is normal for a printer to go offline after a while. This
> probably saves memory or other resources in Windows. And as you
> observed you can still print to the printer.
> OG
>

Re: Connection to network printers by Owen

Owen
Tue Jan 29 13:33:20 CST 2008

On Jan 28, 3:42=A0pm, Peter. <Pe...@discussions.microsoft.com> wrote:
> Thanks, Owen. =A0The status never changes to Offline if installed via the
> wizard.
>
> Here are some additional details
> My print server: =A0Novell based
> Tree name: =A0Helpdesk. =A0
>
> When installed via the wizard, I observed the following:
> Display name: "hpdj4000ps on HELPDESK"
> Port: \\helpdesk\hpdj4000ps
>
> When installed via the script I noticed the following:
> Display name: =A0hpdj4000ps
> Port: \\helpdesk\hpdj4000ps.helpdesk
> Changes to Offline when after I reboot my XP workstation.
>
> Is possible that something might be wrong with the script? =A0
> As far as I have read, the /b changes the print name from "HP Designjet
> 4000ps PS3" to "helpdesk_hpdj4000ps" =A0

Can you still print after rebooting? If you can still print I
wouldn't worry. Surely if you can successfully print the status is
updated?....
It does look like there is some sort of naming problem but I'm not
familiar enough with INF commands to give any advice.
Good luck
OG