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:
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Corey Thomas - MCSE/MCSA/MCDBA
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:DriversHPLaserJet 1320n" oDriver.InfName = "C:DriversHPLaserJet 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:DriversHP....) are on the remote server. I have try to declare paths also like that:
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:DriversHPLaserJet
1320n"
oDriver.InfName = "C:DriversHPLaserJet 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:DriversHP....) are on the remote server.
I have try to declare paths also like that:
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:DriversHPLaserJet 1320n" oDriver.InfName = "C:DriversHPLaserJet 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:DriversHP....) are on the remote server. I have try to declare paths also like that:
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 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:
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:D riversHPLaserJet 1320n" oDriver.InfName = "C:Dr iversHPLaserJet 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:DriversHP....) are on the remote server. I have try to declare paths also like that:
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:
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:D riversHPLaserJet
1320n"
oDriver.InfName = "C:Dr iversHPLaserJet 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:DriversHP....) are on the remote server.
I have try to declare paths also like that:
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 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:
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:D riversHPLaserJet 1320n" oDriver.InfName = "C:Dr iversHPLaserJet 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:DriversHP....) are on the remote server. I have try to declare paths also like that:
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:DriversHPLaserJet 1320n" oDriver.InfName = "C:DriversHPLaserJet 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:DriversHP....) are on the remote server. I have try to declare paths also like that:
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:DriversHPLaserJet
1320n"
oDriver.InfName = "C:DriversHPLaserJet 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:DriversHP....) are on the remote server.
I have try to declare paths also like that:
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:DriversHPLaserJet 1320n" oDriver.InfName = "C:DriversHPLaserJet 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:DriversHP....) are on the remote server. I have try to declare paths also like that:
-- urkec- Masquer le texte des messages précédents -
- Afficher le texte des messages précédents -
Jo
The exact error code is: -2147217406, Err.Description return "Not Found"
Of course, driver files are presents on the server in the spécified 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
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:
if WmiConnect(strServer, kNameSpace, strUser, strPassword, oService) then set oDriver = oService.Get("Win32_PrinterDriver") oDriver.Name = "h p LaserJet 1320 PCL 6" oDriver.SupportedPlatform = "Windows NT x86" oDriver.Version = "3" oDriver.FilePath = "C: DriversHPLaserJet 1320n" oDriver.InfName = "C: DriversHPLaserJet 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:DriversHP....) are on the remote server. I have try to declare paths also like that:
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 = "h p LaserJet 1320 PCL 6"
oDriver.SupportedPlatform = "Windows NT x86"
oDriver.Version = "3"
oDriver.FilePath = "C: DriversHPLaserJet
1320n"
oDriver.InfName = "C: DriversHPLaserJet 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:DriversHP....) are on the remote server.
I have try to declare paths also like that:
The exact error code is: -2147217406, Err.Description return "Not Found"
Of course, driver files are presents on the server in the spécified 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
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:
if WmiConnect(strServer, kNameSpace, strUser, strPassword, oService) then set oDriver = oService.Get("Win32_PrinterDriver") oDriver.Name = "h p LaserJet 1320 PCL 6" oDriver.SupportedPlatform = "Windows NT x86" oDriver.Version = "3" oDriver.FilePath = "C: DriversHPLaserJet 1320n" oDriver.InfName = "C: DriversHPLaserJet 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:DriversHP....) are on the remote server. I have try to declare paths also like that:
2- Script d'installation à distance du driver hp :
--- Coupez ici : InstallDriver.vbs --- Set oWmi=GetObject("winmgmts:srv2003rootcimv2") Set oDrv=oWmi.Get("Win32_PrinterDriver") oDrv.Name="hp LaserJet 1320 PCL 6" oDrv.SupportedPlatform="Windows NT x86" oDrv.Version="3" oDrv.InfName="C:DriversHPLaserJet 1320nhpc1320c.inf" nRc=oDrv.AddPrinterDriver(oDrv) WScript.Echo nRc --- Coupez ici : InstallDriver.vbs ---
3- Sur un poste client XP SP2 Fr
Avec un compte administrateur du serveur Windows 2003 :
> cscript //nologo InstallDriver.vbs 0
-- Gilles LAURENT MVP Windows Server - Admin Frameworks http://glsft.free.fr
Chris Baker
Hi Jo,
I have just run into a similar issue but was getting a return code of 2 from the addprinterdriver method. I have now resolved this as it was only effecting newer HP printer drivers. The reason for this is that the installation files are contained inside cab files. For some reason this method differs from the code in the GUI and cannot extract them.
To resolve the issue just extract the cab file with the same name as the INF file and also the *enww.cab file. This should then resolve the issue, if it is the same problem.
Regards Chris
"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:DriversHPLaserJet 1320n" oDriver.InfName = "C:DriversHPLaserJet 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:DriversHP....) are on the remote server. I have try to declare paths also like that:
I have just run into a similar issue but was getting a return code of 2 from
the addprinterdriver method. I have now resolved this as it was only
effecting newer HP printer drivers. The reason for this is that the
installation files are contained inside cab files. For some reason this
method differs from the code in the GUI and cannot extract them.
To resolve the issue just extract the cab file with the same name as the INF
file and also the *enww.cab file. This should then resolve the issue, if it
is the same problem.
Regards
Chris
"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:DriversHPLaserJet
1320n"
oDriver.InfName = "C:DriversHPLaserJet 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:DriversHP....) are on the remote server.
I have try to declare paths also like that:
I have just run into a similar issue but was getting a return code of 2 from the addprinterdriver method. I have now resolved this as it was only effecting newer HP printer drivers. The reason for this is that the installation files are contained inside cab files. For some reason this method differs from the code in the GUI and cannot extract them.
To resolve the issue just extract the cab file with the same name as the INF file and also the *enww.cab file. This should then resolve the issue, if it is the same problem.
Regards Chris
"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:DriversHPLaserJet 1320n" oDriver.InfName = "C:DriversHPLaserJet 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:DriversHP....) are on the remote server. I have try to declare paths also like that: