Hello,

I try to install remotely a printer driver on a Server2003.

My code is:

if WmiConnect(strServer, kNameSpace, strUser, strPassword,
oService) then
set oDriver = oService.Get("Win32_PrinterDriver")
oDriver.Name = "hp LaserJet 1320 PCL 6"
oDriver.SupportedPlatform = "Windows NT x86"
oDriver.Version = "3"
oDriver.FilePath = "C:\Drivers\HP\LaserJet
1320n"
oDriver.InfName = "C:\Drivers\HP\LaserJet 1320n
\hpc1320c.inf"
uResult = oDriver.AddPrinterDriver(oDriver)

end if

The WmiConnect work fine because remote install of TcpPort work fine
with then same syntax.
All locations (c:\Drivers\HP....) are on the remote server.
I have try to declare paths also like that:

oDriver.FilePath = "C:\\Drivers\\HP\\LaserJet
1320n"
oDriver.InfName = "C:\\Drivers\\HP\\LaserJet
1320n\\hpc1320c.inf"


This code fail. What's wrong?

Thank you very much for your help.

Best regards

Jo

RE: Printer Driver remote installation fail ??? by CoreyThomasMCSEMCSAMCDBA

CoreyThomasMCSEMCSAMCDBA
Tue Mar 11 15:01:01 CDT 2008

What error is returned and what code is saying failed?


-Corey

"Jo" wrote:

> Hello,
>
> I try to install remotely a printer driver on a Server2003.
>
> My code is:
>
> if WmiConnect(strServer, kNameSpace, strUser, strPassword,
> oService) then
> set oDriver = oService.Get("Win32_PrinterDriver")
> oDriver.Name = "hp LaserJet 1320 PCL 6"
> oDriver.SupportedPlatform = "Windows NT x86"
> oDriver.Version = "3"
> oDriver.FilePath = "C:\Drivers\HP\LaserJet
> 1320n"
> oDriver.InfName = "C:\Drivers\HP\LaserJet 1320n
> \hpc1320c.inf"
> uResult = oDriver.AddPrinterDriver(oDriver)
>
> end if
>
> The WmiConnect work fine because remote install of TcpPort work fine
> with then same syntax.
> All locations (c:\Drivers\HP....) are on the remote server.
> I have try to declare paths also like that:
>
> oDriver.FilePath = "C:\\Drivers\\HP\\LaserJet
> 1320n"
> oDriver.InfName = "C:\\Drivers\\HP\\LaserJet
> 1320n\\hpc1320c.inf"
>
>
> This code fail. What's wrong?
>
> Thank you very much for your help.
>
> Best regards
>
> Jo
>

Re: Printer Driver remote installation fail ??? by Jo

Jo
Tue Mar 11 15:25:10 CDT 2008

Hi,

I'm not at wok at this time.
If I remember correctly, AddPrinterDriver return -2147467259
"unspecified automation error"

Tomorrow morning I would give the exact error code.

Jo

On 11 mar, 21:01, Corey Thomas - MCSE/MCSA/MCDBA
<CoreyThomasMCSEMCSAMC...@discussions.microsoft.com> wrote:
> What error is returned and what code is saying failed?
>
> -Corey
>
>
>
> "Jo" wrote:
> > Hello,
>
> > I try to install remotely a printer driver on a Server2003.
>
> > My code is:
>
> > =A0 =A0if WmiConnect(strServer, kNameSpace, strUser, strPassword,
> > oService) then
> > =A0 =A0 =A0 =A0set oDriver =3D oService.Get("Win32_PrinterDriver")
> > =A0 =A0 =A0 =A0oDriver.Name =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D "hp =
LaserJet 1320 PCL 6"
> > =A0 =A0 =A0 =A0oDriver.SupportedPlatform =3D "Windows NT x86"
> > =A0 =A0 =A0 =A0oDriver.Version =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D "3"
> > =A0 =A0 =A0 =A0oDriver.FilePath =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D "C:\D=
rivers\HP\LaserJet
> > 1320n"
> > =A0 =A0 =A0 =A0oDriver.InfName =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D "C:\Dr=
ivers\HP\LaserJet 1320n
> > \hpc1320c.inf"
> > =A0 =A0 =A0 =A0uResult =3D oDriver.AddPrinterDriver(oDriver)
>
> > =A0 =A0end if
>
> > The WmiConnect work fine because remote install of TcpPort work fine
> > with then same syntax.
> > All locations (c:\Drivers\HP....) are on the remote server.
> > I have try to declare paths also like that:
>
> > =A0 =A0 =A0 =A0oDriver.FilePath =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D "C:\\=
Drivers\\HP\\LaserJet
> > 1320n"
> > =A0 =A0 =A0 =A0oDriver.InfName =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D "C:\\D=
rivers\\HP\\LaserJet
> > 1320n\\hpc1320c.inf"
>
> > This code fail. What's wrong?
>
> > Thank you very much for your help.
>
> > Best regards
>
> > Jo- Masquer le texte des messages pr=E9c=E9dents -
>
> - Afficher le texte des messages pr=E9c=E9dents -


RE: Printer Driver remote installation fail ??? by urkec

urkec
Tue Mar 11 15:30:03 CDT 2008

"Jo" wrote:

> Hello,
>
> I try to install remotely a printer driver on a Server2003.
>
> My code is:
>
> if WmiConnect(strServer, kNameSpace, strUser, strPassword,
> oService) then
> set oDriver = oService.Get("Win32_PrinterDriver")
> oDriver.Name = "hp LaserJet 1320 PCL 6"
> oDriver.SupportedPlatform = "Windows NT x86"
> oDriver.Version = "3"
> oDriver.FilePath = "C:\Drivers\HP\LaserJet
> 1320n"
> oDriver.InfName = "C:\Drivers\HP\LaserJet 1320n
> \hpc1320c.inf"
> uResult = oDriver.AddPrinterDriver(oDriver)
>
> end if
>
> The WmiConnect work fine because remote install of TcpPort work fine
> with then same syntax.
> All locations (c:\Drivers\HP....) are on the remote server.
> I have try to declare paths also like that:
>
> oDriver.FilePath = "C:\\Drivers\\HP\\LaserJet
> 1320n"
> oDriver.InfName = "C:\\Drivers\\HP\\LaserJet
> 1320n\\hpc1320c.inf"
>
>
> This code fail. What's wrong?
>
> Thank you very much for your help.
>
> Best regards
>
> Jo
>

It looks like you need a privilege like this to install printer drivers:

objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", True


--
urkec

Re: Printer Driver remote installation fail ??? by Jo

Jo
Wed Mar 12 04:09:03 CDT 2008

My WmiConnect function set this privilege.

Thank's for your answer.
Jo

> It looks like you need a privilege like this to install printer drivers:
>
> objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", Tr=
ue
>
> --
> urkec- Masquer le texte des messages pr=E9c=E9dents -
>
> - Afficher le texte des messages pr=E9c=E9dents -


Re: Printer Driver remote installation fail ??? by Jo

Jo
Wed Mar 12 04:35:57 CDT 2008

The exact error code is: -2147217406, Err.Description return "Not
Found"

Of course, driver files are presents on the server in the sp=E9cified
location.

Any idea?

Thank's in advance
Jo



> If I remember correctly, AddPrinterDriver return -2147467259
> "unspecified automation error"
>
> Tomorrow morning I would give the exact error code.
>
> Jo
>
> On 11 mar, 21:01, Corey Thomas - MCSE/MCSA/MCDBA
>
>
>
> <CoreyThomasMCSEMCSAMC...@discussions.microsoft.com> wrote:
> > What error is returned and what code is saying failed?
>
> > -Corey
>
> > "Jo" wrote:
> > > Hello,
>
> > > I try to install remotely a printer driver on a Server2003.
>
> > > My code is:
>
> > > =A0 =A0if WmiConnect(strServer, kNameSpace, strUser, strPassword,
> > > oService) then
> > > =A0 =A0 =A0 =A0set oDriver =3D oService.Get("Win32_PrinterDriver")
> > > =A0 =A0 =A0 =A0oDriver.Name =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D "h=
p LaserJet 1320 PCL 6"
> > > =A0 =A0 =A0 =A0oDriver.SupportedPlatform =3D "Windows NT x86"
> > > =A0 =A0 =A0 =A0oDriver.Version =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D "3"=

> > > =A0 =A0 =A0 =A0oDriver.FilePath =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D "C:=
\Drivers\HP\LaserJet
> > > 1320n"
> > > =A0 =A0 =A0 =A0oDriver.InfName =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D "C:\=
Drivers\HP\LaserJet 1320n
> > > \hpc1320c.inf"
> > > =A0 =A0 =A0 =A0uResult =3D oDriver.AddPrinterDriver(oDriver)
>
> > > =A0 =A0end if
>
> > > The WmiConnect work fine because remote install of TcpPort work fine
> > > with then same syntax.
> > > All locations (c:\Drivers\HP....) are on the remote server.
> > > I have try to declare paths also like that:
>
> > > =A0 =A0 =A0 =A0oDriver.FilePath =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D "C:=
\\Drivers\\HP\\LaserJet
> > > 1320n"
> > > =A0 =A0 =A0 =A0oDriver.InfName =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D "C:\=
\Drivers\\HP\\LaserJet
> > > 1320n\\hpc1320c.inf"
>
> > > This code fail. What's wrong?
>
> > > Thank you very much for your help.
>
> > > Best regards
>
> > > Jo- Masquer le texte des messages pr=E9c=E9dents -
>
> > - Afficher le texte des messages pr=E9c=E9dents -- Masquer le texte des =
messages pr=E9c=E9dents -
>
> - Afficher le texte des messages pr=E9c=E9dents -