How to delete system default printer forms?

On Windows there are system default printer forms which can't be deleted from the Print Server Properties dialog. Is there some other way they can be removed? We are never going to use page sizes like Envelope, B5(JIS), US Std Fanfold, etc. and I'd like to save users (and myself!) from having to scroll through a big long list of noise.

Print server properties box has a unusable delete button

Our print servers are Windows Server 2003 if that makes any difference.


Solution 1:

My first thought was to see if this could be accomplished by using the Windows API's, but according to this website about the Win32 Printer Forms API, it's not even possible to delete system forms programmatically:

One cannot DeleteForm() on a builtin form: it fails with ERROR_INVALID_PARAMETER.

My second thought was to find a relatively unique form name, such as US Std Fanfold and search the whole registry. Surprisingly, the entry crops in quite a number of places. My suggestion, therefore, would be to build a blank 32 bit machine (32 bit to avoid confusion with shadow keys) and go to town on some of those keys. If you get it working it should be easy to transpose to wherever you need to do this.

However, it has to be said, that given how much Microsoft clearly don't want you to do this, you are opening yourself up to support and compatibility issues.

Solution 2:

Standard paper-forms are part of the printer drivers and can only be deleted manually from the corresponding files.

Here's a guide of how I was able to do it:

1.Open CMD as Administrator.

2.enter "printui /s /t2" (without quotation marks)

3.In the opend window, select a printer, for which paper forms should be deleted, and click Properties on the bottom.

4.Look for the listed files in explorer under the stated path (probably C:\Windows\System32\spool\drivers\x64\3)

5.Make a backup-copy of all these files (e.g. in a folder on Desktop)

6.Open each of the original files with editor (one at a time). If it contains readable code, hit Ctrl+F (to open search) and enter one of the more prominently named paper forms, which should be deleted (e.g. Postcard, Legal, Letter...) If none of the searched words are found, close the file without saving, and try the next file. (In my case I found them in files with extension ".gpd" und ".inx" for physical printers, ".PPD" for my PDF-Creator)

7.When an entry is found: There should be a paragraph with code blocks listed for all the paper forms. Some examples:

    [JAPANESE_POSTCARD]
    MediaType=8.1055
    InputBin=7

or

    *Option: JAPANESE_POSTCARD_90x90x50x95
    {
        *Name: ""
    }

or

    *Option: JAPANESE_POSTCARD
    {
        *rcNameID: =RCID_DMPAPER_SYSTEM_NAME
        *Constraints: LIST(Duplex.VERTICAL, Duplex.HORIZONTAL)
        *Constraints: InputBin.4
        *PageDimensions: PAIR(4724, 6992)
        *PrintableArea: PAIR(4412, 6680)
        *PrintableOrigin: PAIR(156, 156)
        *switch: Orientation
        {
            *case: PORTRAIT
            {
                *CursorOrigin: PAIR(156, 156)
            }
            *case: LANDSCAPE_CC270
            {
                *CursorOrigin: PAIR(4568, 156)
            }
        }
        *Command: CmdSelect
        {
            *CallbackID: 0x00470002
            *Order: DOC_SETUP.2
        }
        *Command: CmdSelect
        {
            *CallbackID: 0x00470002
            *Order: PAGE_SETUP.2
        }
    }

Delete all such blocks for all undesired paper forms. Most likely there are more than one paragraph that contain similar blocks, so keep searching the file and repeat, until none are found. Then save and close the file.

8.After every file changed, open any dokument (e.g. Word, Excel...), and check if the undesired paper forms are still listed in the printing propperties of that printer.

-if still present: back to Step 6, search the next file.

-if not: congratulations! (Back to Step 3, if there are more printers to rid of undesired forms).

-if there are any problems: overwrite last edited file with backup. (Maybe you made a mistake, so try again)

Hope this helps. Cheers!