一.Force JobID in Spoolfile names
On Windows NT/2000 find the files by name xxxxx.spl where xxxxx was the JobID returned by the EnumJobs API.
However, XP and 2003 create spool files named FPnnnnn.spl where nnnnn is no longer the JobID.
This is the side effect of file pooling. You can “turn off” Spool File Pooling by keeping printed jobs or specify a different spool directory. The workaround to this is as below:
To Turn Off Spool File Pooling on a Per Printer Queue-Basis
-
Click Start, click Run, type regedit in the Open box, and then click OK.
-
Locate the following registry subkey, where <printername> is the name of your printer: HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Print/Printers/<printername>
-
In the right pane, right-click SpoolDirectory, and then click Modify.
-
In the Value data box, type the location where you want the spool files to be s tored. For example, type c:/windows/system32/spool/printers as the default location.
-
Quit Registry Edi tor.
-
Restart the Print Spooler service.
All new jobs will be of the form XXXXX.SPL and XXXXX.SHD and will be numbered consistently with their JobIDs.
To Turn Off Spool File Pooling for All Printers
Note: This method only works on Windows 2003 Server. This method does not work for Windows XP.
-
Click Start, click Run, type regedit in the Open box, and then click OK.
-
Locate the following registry subkey: HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/Print
-
On the Edit menu, point to New, and then click DWORD Value.
-
In the New Value #1 box, type DisableServerFilePooling, and then press ENTER.
-
Right-click DisableServerFilePooling, and then click Modify.
-
In the Value data box, type 1 to turn off spool file pooling, and then click OK.
-
Quit Registry Edi tor.
-
Restart the Print Spooler service.
All new jobs will be of the form XXXXX.SPL and XXXXX.SHD and will be numbered consistently with their JobIDs.
二.打印机-属性-高级-保留打印的文档选中
对应注册表中<打印机名字>-DsSpooler-printKeepPrintedJobs = 1