Announcement

Collapse
No announcement yet.

Keep Printed Documents

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Keep Printed Documents

    Hay , i wish this Post find you good
    i have a little problem that i want to save printed documents
    i use this script

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")



    For Each objPrinter in colPrinters
    objPrinter.KeepPrintedJobs = true

    objPrinter.Put_

    objPrinter.RawOnly = true
    Next


    but still have one problem that some printer driver dose not work and gives me a corrupted .SPL file
    by the way all workstation windows Xp AD is 2003
    any other solution to keep printed documents
    Thansk
    Thanks

  • #2
    Re: Keep Printed Documents

    Nothing to do with AD
    Moved to scripting forum
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Re: Keep Printed Documents

      any new scripts

      Comment


      • #4
        Re: Keep Printed Documents

        Give people a chance please -- its only been 10 minutes since your original post.
        If you require immediate help, Microsoft Product Support will be delighted to help you -- all major credit cards accepted
        Tom Jones
        MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
        PhD, MSc, FIAP, MIITT
        IT Trainer / Consultant
        Ossian Ltd
        Scotland

        ** Remember to give credit where credit is due and leave reputation points where appropriate **

        Comment


        • #5
          Re: Keep Printed Documents

          have you talked to the printer manufacturer about it?
          have you tried different drivers... ?
          maybe some of these printers just don't support the function you're trying to configure ?
          Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

          Comment


          • #6
            Re: Keep Printed Documents

            Originally posted by Elawady View Post
            Hay , i wish this Post find you good
            i have a little problem that i want to save printed documents
            i use this script

            strComputer = "."
            Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

            Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")



            For Each objPrinter in colPrinters
            objPrinter.KeepPrintedJobs = true

            objPrinter.Put_

            objPrinter.RawOnly = true
            Next


            but still have one problem that some printer driver dose not work and gives me a corrupted .SPL file
            by the way all workstation windows Xp AD is 2003
            any other solution to keep printed documents
            Thansk
            Thanks
            Are you using the script to edit the attributes of mapped network printers or locally installed printers? You must have admin rights on each of the printers to run this script. You running the script on the print server op on the clients?

            btw, when using objPrinter.Put_ you should add a certain service privilege for making it work also for hardware drivers that not exist in the Driver.cab file on the computer.
            Code:
            Set objWMIService = GetObject _ 
               ("winmgmts:{impersonationLevel=impersonate}!\root\cimv2")
            
            objWMIService.Security_.Privileges._
               AddAsString "SeLoadDriverPrivilege", True
            Corrupted SHD files or its corresonding SPL file is not realy a scripting issue. Have you tried start/stopping the Printer Spooler services and cleared the Spool folder once?

            You wrote "some printers does not work and gives me a corrupted .SPL file", how you know the files are currupted? - any error messages?
            Are those drivers for printer devices (hardware) or for a software product? Are they signed drivers?

            In the printer's queue do you see the document's status is "sent to the printer" - and was the document actually printed the first time?

            Have you checked the Access Control Entries on the printer and also the permissions for the spool directory that this particular printer actually is configured to use.

            /Rems

            This posting is provided "AS IS" with no warranties, and confers no rights.

            __________________

            ** Remember to give credit where credit's due **
            and leave Reputation Points for meaningful posts

            Comment


            • #7
              Re: Keep Printed Documents

              Thanks you Rems

              I use this script to locally installed printers

              also i use deployment software to gain Administrator rights.

              SPL corrupted file dose not work with any viewer like (Spl View) software

              event if i tried to open this file online
              i seems corrupted format but the file is printed and saved in print spool
              the important this is the print processor to make sure it is configured as Winprint and REW for defualt data type this is my workshop but till now im not able to save all printed document in my whole network

              thank you again for your support

              Comment


              • #8
                Re: Keep Printed Documents

                Originally posted by Elawady View Post
                SPL corrupted file dose not work with any viewer like (Spl View) software <,>
                the important this is the print processor to make sure it is configured as Winprint and RAW for default data type
                this script show which print processor each local printer is using:
                Code:
                Set objWMIService = GetObject( _
                    "winmgmts:{impersonationLevel=Impersonate ," _
                    & "(LoadDriver)}!//./root/cimv2")
                
                Set colInstalledPrinters = objWMIService.ExecQuery _
                    ("Select * from Win32_Printer Where (Local=TRUE and Network<>TRUE)")
                
                For Each objPrinter in colInstalledPrinters
                
                   spl = "Start spool Printing immediately: True"
                   If objPrinter.SpoolEnabled = False Then
                   spl = "* Printer queue disabled! *"
                   ElseIf objPrinter.Queued = True then
                   spl = "Start Spool printing immediately: False"
                   End If
                
                   Wscript.Echo "Name" & vbTab & vbTab & ":", objPrinter.Name & _
                     vbNewLine & "Print Processor" & vbTab & ":", objPrinter.printprocessor & _
                     vbNewLine & "Data Type" & vbTab & ":", objPrinter.PrintJobDataType & _
                     vbNewLine & "Keep printed jobs" & vbTab & ":", CStr(objPrinter.KeepPrintedJobs) & _
                     vbNewLine & spl & _
                     vbNewLine & "Port name" & vbTab & ":", objPrinter.PortName
                
                Next
                
                Set objWMIService = Nothing
                Set colInstalledPrinters = Nothing
                If the script returns the info as expected then most likely 'Spl View' or the installed 'printer driver' is the problem.

                /Rems
                Last edited by Rems; 12th July 2011, 15:27.

                This posting is provided "AS IS" with no warranties, and confers no rights.

                __________________

                ** Remember to give credit where credit's due **
                and leave Reputation Points for meaningful posts

                Comment

                Working...
                X