Modifying the MS Print webpage for Internet Printing

By default the Internet Printing web-page only displays 10 printers at a time. In our environment we have over 1600 printers and it would take forever to find the printer you need. By modifying a single line in the following file you can change the maximum number or printers to display per page.

C:\WINNT\Web\Printers\ipp_0001.asp

Change the following line to any number that fits your need.

Const iPrinterLength = 2000

Additionally I removed the Status Column to speed up the time to process the webpage

A section of the orginal ipp_0001.asp looked like this…

    For Each objPrinter In objPrinters

        If i > iRevEnd Then Exit For

        If i > iRevStart Then
            iPrinters = iPrinters + 1

            ReDim Preserve rgPrinters(ADSI_PRINTER_ATTRIBUTES, iPrinters)
            rgPrinters(ADSI_PRINTER_STATUS, iPrinters) = objPrinter.Status
            If Err.Number = &H80070005 Then    ‘Access Denied
                Err.Clear
                rgPrinters(ADSI_PRINTER_NAME, iPrinters) = objPrinter.Name
                rgPrinters(ADSI_PRINTER_ACCESS, iPrinters) = PRINTER_ACCESS_DENIED
                rgPrinters(ADSI_PRINTER_LOCATION, iPrinters) = “”
                rgPrinters(ADSI_PRINTER_MODEL, iPrinters) = “”
                rgPrinters(ADSI_PRINTER_COMMENT, iPrinters) = “<a href=””ipp_0001.asp?v=1&startid=” &_
                    CStr (iStart) & “&endid=” & CStr (iEnd) & “””>” & L_AccessDenied_Text & “</a>”

                rgPrinters(ADSI_PRINTER_JOBS, iPrinters) = 0
            Else
                If Err.Number <> 0 Then
                    Err.Clear
                    rgPrinters(ADSI_PRINTER_NAME, iPrinters) = objPrinter.Name
                    rgPrinters(ADSI_PRINTER_ACCESS, iPrinters) = PRINTER_OPENING
                    rgPrinters(ADSI_PRINTER_LOCATION, iPrinters) = “”
                    rgPrinters(ADSI_PRINTER_MODEL, iPrinters) = “”
                    rgPrinters(ADSI_PRINTER_COMMENT, iPrinters) = L_Opening_Text
                    rgPrinters(ADSI_PRINTER_JOBS, iPrinters) = 0
                Else
                    dwStatus = objPrinter.Status
                    If objPrinter.Attributes And &H400 Then dwStatus = dwStatus Or &H80

                    rgPrinters(ADSI_PRINTER_NAME, iPrinters) = GetFriendlyName (objPrinter.PrinterName, strServerName)
                    rgPrinters(ADSI_PRINTER_STATUS, iPrinters) = dwStatus
                    rgPrinters(ADSI_PRINTER_LOCATION, iPrinters) = strCleanString (objPrinter.Location)
                    rgPrinters(ADSI_PRINTER_MODEL, iPrinters) = strCleanString (objPrinter.Model)
                    rgPrinters(ADSI_PRINTER_COMMENT, iPrinters) = strCleanString (objPrinter.Description)
                    rgPrinters(ADSI_PRINTER_JOBS, iPrinters) = objPrinter.JobCount
                    If Err Then Exit Function

                    rgPrinters(ADSI_PRINTER_ACCESS, iPrinters) = PRINTER_OK
                End If
            End If
        End If

        i = i + 1
    Next

After removing the Status lines this was the final code of that section looked like this…

    For Each objPrinter In objPrinters

        If i > iRevEnd Then Exit For

        If i > iRevStart Then
            iPrinters = iPrinters + 1

            ReDim Preserve rgPrinters(ADSI_PRINTER_ATTRIBUTES, iPrinters)
            If Err.Number = &H80070005 Then    ‘Access Denied
                Err.Clear
                rgPrinters(ADSI_PRINTER_NAME, iPrinters) = objPrinter.Name
                rgPrinters(ADSI_PRINTER_ACCESS, iPrinters) = PRINTER_ACCESS_DENIED
                rgPrinters(ADSI_PRINTER_LOCATION, iPrinters) = “”
                rgPrinters(ADSI_PRINTER_MODEL, iPrinters) = “”
                rgPrinters(ADSI_PRINTER_COMMENT, iPrinters) = “<a href=””ipp_0001.asp?v=1&startid=” &_
                    CStr (iStart) & “&endid=” & CStr (iEnd) & “””>” & L_AccessDenied_Text & “</a>”

            Else
                If Err.Number <> 0 Then
                    Err.Clear
                    rgPrinters(ADSI_PRINTER_NAME, iPrinters) = objPrinter.Name
                    rgPrinters(ADSI_PRINTER_ACCESS, iPrinters) = PRINTER_OPENING
                    rgPrinters(ADSI_PRINTER_LOCATION, iPrinters) = “”
                    rgPrinters(ADSI_PRINTER_MODEL, iPrinters) = “”
                    rgPrinters(ADSI_PRINTER_COMMENT, iPrinters) = L_Opening_Text
                Else

                    rgPrinters(ADSI_PRINTER_NAME, iPrinters) = GetFriendlyName (objPrinter.PrinterName, strServerName)
                    rgPrinters(ADSI_PRINTER_LOCATION, iPrinters) = strCleanString (objPrinter.Location)
                    rgPrinters(ADSI_PRINTER_MODEL, iPrinters) = strCleanString (objPrinter.Model)
                    rgPrinters(ADSI_PRINTER_COMMENT, iPrinters) = strCleanString (objPrinter.Description)
                    If Err Then Exit Function

                    rgPrinters(ADSI_PRINTER_ACCESS, iPrinters) = PRINTER_OK
                End If
            End If
        End If

        i = i + 1
    Next

One thought on “Modifying the MS Print webpage for Internet Printing

  1. Thank you! I’m busily modifying this so it looks… professional? And is more usable.

Leave a Reply

Your email address will not be published. Required fields are marked *