Installing Printer Drivers via VBS
I've been searching and searching for a solution to this problem and it seems
that I can't find it.
I'm using the VBS provided on MS TechNet and am getting a strange error.
Below is the script I'm using and the error that I get.
*InstPrntDrv.vbs*
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", True
Set objDriver = objWMIService.Get("Win32_PrinterDriver")
objDriver.Name = "Fiery S300 50C-K v1.1"
objDriver.SupportedPlatform = "Windows NT x86"
objDriver.Version = "3"
objDriver.DriverPath = "C:\prntdrvr\PRNTDRVR\Ps_drvr\Win_2K_XP\"
objDriver.Infname = "C:\prntdrvr\PRNTDRVR\Ps_drvr\Win_2K_XP\oemsetup.inf"
intResult = objDriver.AddPrinterDriver(objDriver)
Wscript.Echo intResult
*Error.txt*
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
-536870353
--
Regards,
Charlie
Re: Installing Printer Drivers via VBS
If the driver is not signed, one cannot use WMI scripting to install the
driver. Make sure the cat file for the package is copied to the same
location as the driver files if the driver is signed.
--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto
This posting is provided "AS IS" with no warranties, and confers no rights.
"Charlie S" <CharlieS@discussions.microsoft.com> wrote in message
news:A5C325B1-0F6E-40B4-81DD-AB5A59A6C8C5@microsoft.com...
> I've been searching and searching for a solution to this problem and it
> seems
> that I can't find it.
>
> I'm using the VBS provided on MS TechNet and am getting a strange error.
> Below is the script I'm using and the error that I get.
>
> *InstPrntDrv.vbs*
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege",
> True
>
> Set objDriver = objWMIService.Get("Win32_PrinterDriver")
>
> objDriver.Name = "Fiery S300 50C-K v1.1"
> objDriver.SupportedPlatform = "Windows NT x86"
> objDriver.Version = "3"
> objDriver.DriverPath = "C:\prntdrvr\PRNTDRVR\Ps_drvr\Win_2K_XP\"
> objDriver.Infname = "C:\prntdrvr\PRNTDRVR\Ps_drvr\Win_2K_XP\oemsetup.inf"
> intResult = objDriver.AddPrinterDriver(objDriver)
> Wscript.Echo intResult
>
>
> *Error.txt*
> Microsoft (R) Windows Script Host Version 5.6
> Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
>
> -536870353
>
>
> --
> Regards,
>
> Charlie
Re: Installing Printer Drivers via VBS
Hi Alan,
Is there any way to install the unsigned drivers.
Regards
Sudhakar K
"Alan Morris [MSFT]" wrote:
> If the driver is not signed, one cannot use WMI scripting to install the
> driver. Make sure the cat file for the package is copied to the same
> location as the driver files if the driver is signed.
>
> --
> Alan Morris
> Windows Printing Team
> Search the Microsoft Knowledge Base here:
> http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Charlie S" <CharlieS@discussions.microsoft.com> wrote in message
> news:A5C325B1-0F6E-40B4-81DD-AB5A59A6C8C5@microsoft.com...
> > I've been searching and searching for a solution to this problem and it
> > seems
> > that I can't find it.
> >
> > I'm using the VBS provided on MS TechNet and am getting a strange error.
> > Below is the script I'm using and the error that I get.
> >
> > *InstPrntDrv.vbs*
> > strComputer = "."
> > Set objWMIService = GetObject("winmgmts:" _
> > & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> > objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege",
> > True
> >
> > Set objDriver = objWMIService.Get("Win32_PrinterDriver")
> >
> > objDriver.Name = "Fiery S300 50C-K v1.1"
> > objDriver.SupportedPlatform = "Windows NT x86"
> > objDriver.Version = "3"
> > objDriver.DriverPath = "C:\prntdrvr\PRNTDRVR\Ps_drvr\Win_2K_XP\"
> > objDriver.Infname = "C:\prntdrvr\PRNTDRVR\Ps_drvr\Win_2K_XP\oemsetup.inf"
> > intResult = objDriver.AddPrinterDriver(objDriver)
> > Wscript.Echo intResult
> >
> >
> > *Error.txt*
> > Microsoft (R) Windows Script Host Version 5.6
> > Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
> >
> > -536870353
> >
> >
> > --
> > Regards,
> >
> > Charlie
>
>
>
Re: Installing Printer Drivers via VBS
rundll32
rundll32 printui,PrintUIEntry /?
--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto
This posting is provided "AS IS" with no warranties, and confers no rights.
"SUDHAKAR KUNCHI" <SUDHAKAR KUNCHI@discussions.microsoft.com> wrote in
message news:86784D5B-0908-44C9-B80A-49F1239C4933@microsoft.com...
> Hi Alan,
>
> Is there any way to install the unsigned drivers.
>
> Regards
> Sudhakar K
>
> "Alan Morris [MSFT]" wrote:
>
>> If the driver is not signed, one cannot use WMI scripting to install the
>> driver. Make sure the cat file for the package is copied to the same
>> location as the driver files if the driver is signed.
>>
>> --
>> Alan Morris
>> Windows Printing Team
>> Search the Microsoft Knowledge Base here:
>> http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto
>>
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Charlie S" <CharlieS@discussions.microsoft.com> wrote in message
>> news:A5C325B1-0F6E-40B4-81DD-AB5A59A6C8C5@microsoft.com...
>> > I've been searching and searching for a solution to this problem and it
>> > seems
>> > that I can't find it.
>> >
>> > I'm using the VBS provided on MS TechNet and am getting a strange
>> > error.
>> > Below is the script I'm using and the error that I get.
>> >
>> > *InstPrntDrv.vbs*
>> > strComputer = "."
>> > Set objWMIService = GetObject("winmgmts:" _
>> > & "{impersonationLevel=impersonate}!\\" & strComputer &
>> > "\root\cimv2")
>> > objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege",
>> > True
>> >
>> > Set objDriver = objWMIService.Get("Win32_PrinterDriver")
>> >
>> > objDriver.Name = "Fiery S300 50C-K v1.1"
>> > objDriver.SupportedPlatform = "Windows NT x86"
>> > objDriver.Version = "3"
>> > objDriver.DriverPath = "C:\prntdrvr\PRNTDRVR\Ps_drvr\Win_2K_XP\"
>> > objDriver.Infname =
>> > "C:\prntdrvr\PRNTDRVR\Ps_drvr\Win_2K_XP\oemsetup.inf"
>> > intResult = objDriver.AddPrinterDriver(objDriver)
>> > Wscript.Echo intResult
>> >
>> >
>> > *Error.txt*
>> > Microsoft (R) Windows Script Host Version 5.6
>> > Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
>> >
>> > -536870353
>> >
>> >
>> > --
>> > Regards,
>> >
>> > Charlie
>>
>>
>>
RE: Installing Printer Drivers via VBS
Hi Alan,
I am using the script TechNet sugested, i edited the vbs to install a new
driver to a set of computers. when I test the .vbs scritp I get an error
message. it is :
Script: C:\DandS\... AddPrinterDriver.vbs
Line: 2
Char: 1
Error: 0x80041002
Code: 80041002
Source: (null)
any Ideas as to what is causing this error? I copied my edited .vbs below:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", True
Set objDriver = objWMIService.Get("SAVIN C4540 PCL 6")
objDriver.Name = "SAVIN C4540 PCL 6"
objDriver.SupportedPlatform = "Windows NT x86"
objDriver.Version = "1.10"
objDriver.DriverPath =
"\\boxwood\packs\Drivers\Printers\SavonC4540\sav641k.dl_"
objDriver.Infname = "\\boxwood\packs\Drivers\Printers\SAVON
C4540\OEMSETUP.INF"
intResult = objDriver.AddPrinterDriver(objDriver)
-DJAC