Results 1 to 5 of 5

Thread: Installing Printer Drivers via VBS

  1. #1
    Charlie S Guest

    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

  2. #2
    Alan Morris [MSFT] Guest

    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




  3. #3
    SUDHAKAR KUNCHI Guest

    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

    >
    >
    >


  4. #4
    Alan Morris [MSFT] Guest

    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

    >>
    >>
    >>




  5. #5
    crazydjac Guest

    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

Similar Threads

  1. Replies: 3
    Last Post: 03-01-2014, 10:32 AM
  2. Script to Install Printer Drivers w/o adding printer
    By witecoko in forum Windows XP Support
    Replies: 7
    Last Post: 13-03-2013, 11:32 AM
  3. Replies: 5
    Last Post: 06-12-2010, 11:10 PM
  4. Replies: 13
    Last Post: 20-08-2008, 11:55 PM
  5. HP PCL 6 Printer Drivers
    By Kate in forum Windows Update
    Replies: 3
    Last Post: 26-06-2007, 09:13 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,875,930.22241 seconds with 17 queries