Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Installing Printer Drivers via VBS

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 13-10-2006
Charlie S
 
Posts: n/a
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

Reply With Quote
  #2  
Old 16-10-2006
Alan Morris [MSFT]
 
Posts: n/a
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



Reply With Quote
  #3  
Old 12-01-2007
SUDHAKAR KUNCHI
 
Posts: n/a
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

>
>
>

Reply With Quote
  #4  
Old 15-01-2007
Alan Morris [MSFT]
 
Posts: n/a
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

>>
>>
>>



Reply With Quote
  #5  
Old 27-02-2007
crazydjac
 
Posts: n/a
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
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Installing Printer Drivers via VBS"
Thread Thread Starter Forum Replies Last Post
Tata Photon Whiz Olive CM200 not installing on windows 7(Drivers not installing) tjaay11 Windows Software 3 03-01-2014 10:32 AM
Script to Install Printer Drivers w/o adding printer witecoko Windows XP Support 7 13-03-2013 11:32 AM
Removing Hp printer drivers shows error "Printer Management tool Missing " Udyami Hardware Peripherals 5 06-12-2010 11:10 PM
Installing HP Deskjet 722C printer drivers on a Vista machine ? Warren Vista Help 13 20-08-2008 11:55 PM
HP PCL 6 Printer Drivers Kate Windows Update 3 26-06-2007 09:13 PM


All times are GMT +5.5. The time now is 10:48 AM.